@lde/pipeline-console-reporter 0.15.7 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,7 @@ export declare class ConsoleReporter implements ProgressReporter {
|
|
|
24
24
|
stageProgress(update: {
|
|
25
25
|
itemsProcessed: number;
|
|
26
26
|
quadsGenerated: number;
|
|
27
|
+
memoryUsageBytes: number;
|
|
27
28
|
}): void;
|
|
28
29
|
stageComplete(_stage: string, result: {
|
|
29
30
|
itemsProcessed: number;
|
|
@@ -33,10 +34,13 @@ export declare class ConsoleReporter implements ProgressReporter {
|
|
|
33
34
|
stageFailed(_stage: string, error: Error): void;
|
|
34
35
|
stageValidated(_stage: string, report: ValidationReport): void;
|
|
35
36
|
stageSkipped(_stage: string, reason: string): void;
|
|
36
|
-
datasetComplete(_dataset: Dataset
|
|
37
|
+
datasetComplete(_dataset: Dataset, result: {
|
|
38
|
+
memoryUsageBytes: number;
|
|
39
|
+
}): void;
|
|
37
40
|
datasetSkipped(_dataset: Dataset, reason: string): void;
|
|
38
41
|
pipelineComplete(result: {
|
|
39
42
|
duration: number;
|
|
43
|
+
memoryUsageBytes: number;
|
|
40
44
|
}): void;
|
|
41
45
|
}
|
|
42
46
|
//# sourceMappingURL=consoleReporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleReporter.d.ts","sourceRoot":"","sources":["../src/consoleReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"consoleReporter.d.ts","sourceRoot":"","sources":["../src/consoleReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;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AC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,GACA,IAAI;IAUP,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAQ/C,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAc9D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQlD,eAAe,CACb,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,GACnC,IAAI;IASP,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAIvD,gBAAgB,CAAC,MAAM,EAAE;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,IAAI;CAOT"}
|
package/dist/consoleReporter.js
CHANGED
|
@@ -6,6 +6,10 @@ const compactNumber = new Intl.NumberFormat('en', {
|
|
|
6
6
|
notation: 'compact',
|
|
7
7
|
maximumFractionDigits: 1,
|
|
8
8
|
});
|
|
9
|
+
function formatBytes(bytes) {
|
|
10
|
+
const megabytes = bytes / 1024 / 1024;
|
|
11
|
+
return `${megabytes.toFixed(0)} MB`;
|
|
12
|
+
}
|
|
9
13
|
export class ConsoleReporter {
|
|
10
14
|
activeSpinner;
|
|
11
15
|
stageStartTime = 0;
|
|
@@ -145,7 +149,7 @@ export class ConsoleReporter {
|
|
|
145
149
|
stageProgress(update) {
|
|
146
150
|
if (this.activeSpinner) {
|
|
147
151
|
const elapsed = prettyMilliseconds(Date.now() - this.stageStartTime);
|
|
148
|
-
this.activeSpinner.suffixText = `${compactNumber.format(update.itemsProcessed)} items, ${compactNumber.format(update.quadsGenerated)} quads, ${elapsed}`;
|
|
152
|
+
this.activeSpinner.suffixText = `${compactNumber.format(update.itemsProcessed)} items, ${compactNumber.format(update.quadsGenerated)} quads, ${elapsed}, memory: ${formatBytes(update.memoryUsageBytes)}`;
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
stageComplete(_stage, result) {
|
|
@@ -177,13 +181,13 @@ export class ConsoleReporter {
|
|
|
177
181
|
this.activeSpinner = undefined;
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
|
-
datasetComplete(_dataset) {
|
|
181
|
-
this.printLine('succeed', `Completed in ${chalk.bold(prettyMilliseconds(Date.now() - this.datasetStartTime))}`);
|
|
184
|
+
datasetComplete(_dataset, result) {
|
|
185
|
+
this.printLine('succeed', `Completed in ${chalk.bold(prettyMilliseconds(Date.now() - this.datasetStartTime))} ${chalk.dim(`(memory: ${formatBytes(result.memoryUsageBytes)})`)}`);
|
|
182
186
|
}
|
|
183
187
|
datasetSkipped(_dataset, reason) {
|
|
184
188
|
this.printLine('fail', `Skipped: ${chalk.red(reason)}`);
|
|
185
189
|
}
|
|
186
190
|
pipelineComplete(result) {
|
|
187
|
-
process.stderr.write(`\nPipeline completed in ${chalk.bold(prettyMilliseconds(result.duration))}\n`);
|
|
191
|
+
process.stderr.write(`\nPipeline completed in ${chalk.bold(prettyMilliseconds(result.duration))} ${chalk.dim(`(memory: ${formatBytes(result.memoryUsageBytes)})`)}\n`);
|
|
188
192
|
}
|
|
189
193
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/pipeline-console-reporter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Console progress reporter for @lde/pipeline",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/ldelements/lde.git",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@lde/dataset": "0.7.2",
|
|
35
|
-
"@lde/pipeline": "0.
|
|
35
|
+
"@lde/pipeline": "0.25.0"
|
|
36
36
|
}
|
|
37
37
|
}
|