@reliverse/dler 2.0.0 ā 2.0.2
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.
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +3 -0
- package/dist/cmds/build/cmd.d.ts +2 -0
- package/dist/cmds/build/cmd.js +564 -0
- package/dist/cmds/clean/cmd.d.ts +2 -0
- package/dist/cmds/clean/cmd.js +146 -0
- package/dist/cmds/clean/impl.d.ts +2 -0
- package/dist/cmds/clean/impl.js +627 -0
- package/dist/cmds/clean/presets.d.ts +10 -0
- package/dist/cmds/clean/presets.js +112 -0
- package/dist/cmds/clean/types.d.ts +62 -0
- package/dist/cmds/clean/types.js +0 -0
- package/dist/cmds/init/cmd.d.ts +3 -0
- package/dist/cmds/init/cmd.js +56 -0
- package/dist/cmds/init/impl/config.d.ts +45 -0
- package/dist/cmds/init/impl/config.js +99 -0
- package/dist/cmds/init/impl/generators.d.ts +6 -0
- package/dist/cmds/init/impl/generators.js +178 -0
- package/dist/cmds/init/impl/prompts.d.ts +2 -0
- package/dist/cmds/init/impl/prompts.js +98 -0
- package/dist/cmds/init/impl/types.d.ts +22 -0
- package/dist/cmds/init/impl/types.js +0 -0
- package/dist/cmds/init/impl/utils.d.ts +4 -0
- package/dist/cmds/init/impl/utils.js +11 -0
- package/dist/cmds/init/impl/validators.d.ts +4 -0
- package/dist/cmds/init/impl/validators.js +42 -0
- package/dist/cmds/integrate/cmd.d.ts +3 -0
- package/dist/cmds/integrate/cmd.js +70 -0
- package/dist/cmds/integrate/impl.d.ts +7 -0
- package/dist/cmds/integrate/impl.js +127 -0
- package/dist/cmds/integrate/integrations/base.d.ts +13 -0
- package/dist/cmds/integrate/integrations/base.js +41 -0
- package/dist/cmds/integrate/integrations/nextjs.d.ts +16 -0
- package/dist/cmds/integrate/integrations/nextjs.js +167 -0
- package/dist/cmds/integrate/integrations/registry.d.ts +7 -0
- package/dist/cmds/integrate/integrations/registry.js +31 -0
- package/dist/cmds/integrate/integrations/ultracite.d.ts +11 -0
- package/dist/cmds/integrate/integrations/ultracite.js +40 -0
- package/dist/cmds/integrate/types.d.ts +39 -0
- package/dist/cmds/integrate/types.js +0 -0
- package/dist/cmds/integrate/utils/biome.d.ts +4 -0
- package/dist/cmds/integrate/utils/biome.js +140 -0
- package/dist/cmds/integrate/utils/context.d.ts +3 -0
- package/dist/cmds/integrate/utils/context.js +111 -0
- package/dist/cmds/integrate/utils/temp.d.ts +3 -0
- package/dist/cmds/integrate/utils/temp.js +36 -0
- package/dist/cmds/perf/analysis/bundle.d.ts +20 -0
- package/dist/cmds/perf/analysis/bundle.js +225 -0
- package/dist/cmds/perf/analysis/filesystem.d.ts +27 -0
- package/dist/cmds/perf/analysis/filesystem.js +246 -0
- package/dist/cmds/perf/analysis/monorepo.d.ts +29 -0
- package/dist/cmds/perf/analysis/monorepo.js +307 -0
- package/dist/cmds/perf/benchmarks/command.d.ts +21 -0
- package/dist/cmds/perf/benchmarks/command.js +162 -0
- package/dist/cmds/perf/benchmarks/memory.d.ts +41 -0
- package/dist/cmds/perf/benchmarks/memory.js +169 -0
- package/dist/cmds/perf/benchmarks/runner.d.ts +22 -0
- package/dist/cmds/perf/benchmarks/runner.js +157 -0
- package/dist/cmds/perf/cmd.d.ts +2 -0
- package/dist/cmds/perf/cmd.js +238 -0
- package/dist/cmds/perf/impl.d.ts +24 -0
- package/dist/cmds/perf/impl.js +304 -0
- package/dist/cmds/perf/reporters/console.d.ts +12 -0
- package/dist/cmds/perf/reporters/console.js +257 -0
- package/dist/cmds/perf/reporters/html.d.ts +27 -0
- package/dist/cmds/perf/reporters/html.js +881 -0
- package/dist/cmds/perf/reporters/json.d.ts +9 -0
- package/dist/cmds/perf/reporters/json.js +32 -0
- package/dist/cmds/perf/types.d.ts +184 -0
- package/dist/cmds/perf/types.js +0 -0
- package/dist/cmds/perf/utils/cache.d.ts +23 -0
- package/dist/cmds/perf/utils/cache.js +171 -0
- package/dist/cmds/perf/utils/formatter.d.ts +17 -0
- package/dist/cmds/perf/utils/formatter.js +134 -0
- package/dist/cmds/perf/utils/stats.d.ts +15 -0
- package/dist/cmds/perf/utils/stats.js +101 -0
- package/dist/cmds/publish/cmd.d.ts +3 -0
- package/dist/cmds/publish/cmd.js +189 -0
- package/dist/cmds/shell/cmd.d.ts +3 -0
- package/dist/cmds/shell/cmd.js +50 -0
- package/dist/cmds/tsc/cache.d.ts +27 -0
- package/dist/cmds/tsc/cache.js +160 -0
- package/dist/cmds/tsc/cmd.d.ts +2 -0
- package/dist/cmds/tsc/cmd.js +111 -0
- package/dist/cmds/tsc/impl.d.ts +41 -0
- package/dist/cmds/tsc/impl.js +572 -0
- package/dist/cmds/tsc/types.d.ts +57 -0
- package/dist/cmds/tsc/types.js +0 -0
- package/package.json +4 -11
- package/src/cli.ts +8 -0
- package/src/cmds/build/cmd.ts +582 -0
- package/src/cmds/clean/cmd.ts +166 -0
- package/src/cmds/clean/impl.ts +900 -0
- package/src/cmds/clean/presets.ts +158 -0
- package/src/cmds/clean/types.ts +71 -0
- package/src/cmds/init/cmd.ts +68 -0
- package/src/cmds/init/impl/config.ts +105 -0
- package/src/cmds/init/impl/generators.ts +220 -0
- package/src/cmds/init/impl/prompts.ts +137 -0
- package/src/cmds/init/impl/types.ts +25 -0
- package/src/cmds/init/impl/utils.ts +17 -0
- package/src/cmds/init/impl/validators.ts +55 -0
- package/src/cmds/integrate/cmd.ts +82 -0
- package/src/cmds/integrate/impl.ts +204 -0
- package/src/cmds/integrate/integrations/base.ts +69 -0
- package/src/cmds/integrate/integrations/nextjs.ts +227 -0
- package/src/cmds/integrate/integrations/registry.ts +45 -0
- package/src/cmds/integrate/integrations/ultracite.ts +53 -0
- package/src/cmds/integrate/types.ts +48 -0
- package/src/cmds/integrate/utils/biome.ts +173 -0
- package/src/cmds/integrate/utils/context.ts +148 -0
- package/src/cmds/integrate/utils/temp.ts +47 -0
- package/src/cmds/perf/analysis/bundle.ts +311 -0
- package/src/cmds/perf/analysis/filesystem.ts +324 -0
- package/src/cmds/perf/analysis/monorepo.ts +439 -0
- package/src/cmds/perf/benchmarks/command.ts +230 -0
- package/src/cmds/perf/benchmarks/memory.ts +249 -0
- package/src/cmds/perf/benchmarks/runner.ts +220 -0
- package/src/cmds/perf/cmd.ts +285 -0
- package/src/cmds/perf/impl.ts +411 -0
- package/src/cmds/perf/reporters/console.ts +331 -0
- package/src/cmds/perf/reporters/html.ts +984 -0
- package/src/cmds/perf/reporters/json.ts +42 -0
- package/src/cmds/perf/types.ts +220 -0
- package/src/cmds/perf/utils/cache.ts +234 -0
- package/src/cmds/perf/utils/formatter.ts +190 -0
- package/src/cmds/perf/utils/stats.ts +153 -0
- package/src/cmds/publish/cmd.ts +215 -0
- package/src/cmds/shell/cmd.ts +61 -0
- package/src/cmds/tsc/cache.ts +237 -0
- package/src/cmds/tsc/cmd.ts +139 -0
- package/src/cmds/tsc/impl.ts +855 -0
- package/src/cmds/tsc/types.ts +66 -0
- package/tsconfig.json +9 -0
- package/cli.js +0 -1316
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// apps/dler/src/cmds/perf/reporters/console.ts
|
|
2
|
+
|
|
3
|
+
import { logger } from "@reliverse/dler-logger";
|
|
4
|
+
import type {
|
|
5
|
+
BenchmarkResult,
|
|
6
|
+
BundleAnalysisResult,
|
|
7
|
+
FileSystemAnalysisResult,
|
|
8
|
+
MonorepoAnalysisResult,
|
|
9
|
+
PerfReport,
|
|
10
|
+
} from "../types";
|
|
11
|
+
import {
|
|
12
|
+
formatBottleneckType,
|
|
13
|
+
formatBytes,
|
|
14
|
+
formatDuration,
|
|
15
|
+
formatNumber,
|
|
16
|
+
formatPercentage,
|
|
17
|
+
formatRelativeChange,
|
|
18
|
+
formatSeverity,
|
|
19
|
+
formatTable,
|
|
20
|
+
truncatePath,
|
|
21
|
+
} from "../utils/formatter";
|
|
22
|
+
|
|
23
|
+
export class ConsoleReporter {
|
|
24
|
+
private verbose: boolean;
|
|
25
|
+
|
|
26
|
+
constructor(verbose = false) {
|
|
27
|
+
this.verbose = verbose;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
report(report: PerfReport): void {
|
|
31
|
+
logger.log("ā".repeat(80));
|
|
32
|
+
logger.log("š Performance Analysis Report");
|
|
33
|
+
logger.log("ā".repeat(80));
|
|
34
|
+
|
|
35
|
+
if (report.benchmark) {
|
|
36
|
+
this.reportBenchmark(report.benchmark);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (report.bundleAnalysis) {
|
|
40
|
+
this.reportBundleAnalysis(report.bundleAnalysis);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (report.fileSystemAnalysis) {
|
|
44
|
+
this.reportFileSystemAnalysis(report.fileSystemAnalysis);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (report.monorepoAnalysis) {
|
|
48
|
+
this.reportMonorepoAnalysis(report.monorepoAnalysis);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (report.baseline) {
|
|
52
|
+
this.reportBaselineComparison(report.baseline);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
logger.log("ā".repeat(80));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private reportBenchmark(result: BenchmarkResult): void {
|
|
59
|
+
logger.log("\nš Command Benchmark Results");
|
|
60
|
+
logger.log("ā".repeat(40));
|
|
61
|
+
|
|
62
|
+
// Summary
|
|
63
|
+
logger.log(`Command: ${result.command}`);
|
|
64
|
+
logger.log(`Runs: ${result.runs} (${result.warmup} warmup)`);
|
|
65
|
+
logger.log(`Concurrency: ${result.concurrency}`);
|
|
66
|
+
logger.log(`Success: ${result.success ? "ā
" : "ā"}`);
|
|
67
|
+
|
|
68
|
+
if (!result.success && result.error) {
|
|
69
|
+
logger.error(`Error: ${result.error}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Timing statistics
|
|
73
|
+
logger.log("\nā±ļø Timing Statistics:");
|
|
74
|
+
logger.log(` Mean: ${formatDuration(result.statistics.mean)}`);
|
|
75
|
+
logger.log(` Median: ${formatDuration(result.statistics.median)}`);
|
|
76
|
+
logger.log(` Min: ${formatDuration(result.statistics.min)}`);
|
|
77
|
+
logger.log(` Max: ${formatDuration(result.statistics.max)}`);
|
|
78
|
+
logger.log(` P95: ${formatDuration(result.statistics.p95)}`);
|
|
79
|
+
logger.log(` P99: ${formatDuration(result.statistics.p99)}`);
|
|
80
|
+
logger.log(
|
|
81
|
+
` Std Dev: ${formatDuration(result.statistics.standardDeviation)}`,
|
|
82
|
+
);
|
|
83
|
+
logger.log(
|
|
84
|
+
` CV: ${(result.statistics.coefficientOfVariation * 100).toFixed(2)}%`,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// Memory statistics
|
|
88
|
+
logger.log("\nš¾ Memory Statistics:");
|
|
89
|
+
logger.log(` Peak RSS: ${formatBytes(result.memory.peak.rss)}`);
|
|
90
|
+
logger.log(` Avg RSS: ${formatBytes(result.memory.average.rss)}`);
|
|
91
|
+
logger.log(` Peak Heap: ${formatBytes(result.memory.peak.heapUsed)}`);
|
|
92
|
+
logger.log(` Avg Heap: ${formatBytes(result.memory.average.heapUsed)}`);
|
|
93
|
+
logger.log(` Growth: ${formatBytes(result.memory.growth)}`);
|
|
94
|
+
|
|
95
|
+
// Individual runs (if verbose)
|
|
96
|
+
if (this.verbose && result.measurements.length > 0) {
|
|
97
|
+
logger.log("\nš Individual Runs:");
|
|
98
|
+
const headers = ["Run", "Duration", "RSS", "Heap", "Status"];
|
|
99
|
+
const rows = result.measurements.map((m, i) => [
|
|
100
|
+
(i + 1).toString(),
|
|
101
|
+
formatDuration(m.duration),
|
|
102
|
+
formatBytes(m.memory.rss),
|
|
103
|
+
formatBytes(m.memory.heapUsed),
|
|
104
|
+
m.success ? "ā
" : "ā",
|
|
105
|
+
]);
|
|
106
|
+
|
|
107
|
+
logger.log(formatTable(headers, rows));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private reportBundleAnalysis(result: BundleAnalysisResult): void {
|
|
112
|
+
logger.log("\nš¦ Bundle Analysis Results");
|
|
113
|
+
logger.log("ā".repeat(40));
|
|
114
|
+
|
|
115
|
+
// Summary
|
|
116
|
+
logger.log(`Target: ${result.target}`);
|
|
117
|
+
logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
|
|
118
|
+
logger.log(`File Count: ${formatNumber(result.fileCount)}`);
|
|
119
|
+
logger.log(
|
|
120
|
+
`Compression Potential: ${result.compressionPotential.toFixed(1)}%`,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// Largest files
|
|
124
|
+
if (result.largestFiles.length > 0) {
|
|
125
|
+
logger.log("\nš Largest Files:");
|
|
126
|
+
const headers = ["File", "Size", "Percentage", "Type"];
|
|
127
|
+
const rows = result.largestFiles.map((file) => [
|
|
128
|
+
truncatePath(file.path, 50),
|
|
129
|
+
formatBytes(file.size),
|
|
130
|
+
formatPercentage(file.percentage, 100),
|
|
131
|
+
file.type,
|
|
132
|
+
]);
|
|
133
|
+
|
|
134
|
+
logger.log(formatTable(headers, rows));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Modules (if available)
|
|
138
|
+
if (result.modules.length > 0) {
|
|
139
|
+
logger.log("\nš Top Modules:");
|
|
140
|
+
const headers = ["Module", "Size", "Percentage", "Type"];
|
|
141
|
+
const rows = result.modules.map((module) => [
|
|
142
|
+
truncatePath(module.name, 50),
|
|
143
|
+
formatBytes(module.size),
|
|
144
|
+
formatPercentage(module.percentage, 100),
|
|
145
|
+
module.isExternal ? "External" : "Internal",
|
|
146
|
+
]);
|
|
147
|
+
|
|
148
|
+
logger.log(formatTable(headers, rows));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Duplicates (if available)
|
|
152
|
+
if (result.duplicates.length > 0) {
|
|
153
|
+
logger.log("\nš Duplicate Dependencies:");
|
|
154
|
+
const headers = ["Module", "Count", "Total Size", "Locations"];
|
|
155
|
+
const rows = result.duplicates.map((dup) => [
|
|
156
|
+
truncatePath(dup.name, 30),
|
|
157
|
+
dup.count.toString(),
|
|
158
|
+
formatBytes(dup.totalSize),
|
|
159
|
+
dup.locations.length.toString(),
|
|
160
|
+
]);
|
|
161
|
+
|
|
162
|
+
logger.log(formatTable(headers, rows));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private reportFileSystemAnalysis(result: FileSystemAnalysisResult): void {
|
|
167
|
+
logger.log("\nš File System Analysis Results");
|
|
168
|
+
logger.log("ā".repeat(40));
|
|
169
|
+
|
|
170
|
+
// Summary
|
|
171
|
+
logger.log(`Target: ${result.target}`);
|
|
172
|
+
logger.log(`Total Files: ${formatNumber(result.totalFiles)}`);
|
|
173
|
+
logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
|
|
174
|
+
logger.log(`Directories: ${formatNumber(result.directoryCount)}`);
|
|
175
|
+
logger.log(`Max Depth: ${result.maxDepth}`);
|
|
176
|
+
logger.log(
|
|
177
|
+
`Compression Potential: ${result.compressionPotential.toFixed(1)}%`,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
// Largest files
|
|
181
|
+
if (result.largestFiles.length > 0) {
|
|
182
|
+
logger.log("\nš Largest Files:");
|
|
183
|
+
const headers = ["File", "Size", "Percentage", "Type"];
|
|
184
|
+
const rows = result.largestFiles.map((file) => [
|
|
185
|
+
truncatePath(file.path, 50),
|
|
186
|
+
formatBytes(file.size),
|
|
187
|
+
formatPercentage(file.percentage, 100),
|
|
188
|
+
file.type,
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
logger.log(formatTable(headers, rows));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Largest directories
|
|
195
|
+
if (result.largestDirectories.length > 0) {
|
|
196
|
+
logger.log("\nš Largest Directories:");
|
|
197
|
+
const headers = ["Directory", "Size", "Files", "Depth"];
|
|
198
|
+
const rows = result.largestDirectories.map((dir) => [
|
|
199
|
+
truncatePath(dir.path, 50),
|
|
200
|
+
formatBytes(dir.size),
|
|
201
|
+
formatNumber(dir.fileCount),
|
|
202
|
+
dir.depth.toString(),
|
|
203
|
+
]);
|
|
204
|
+
|
|
205
|
+
logger.log(formatTable(headers, rows));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// File types
|
|
209
|
+
if (result.fileTypes.length > 0) {
|
|
210
|
+
logger.log("\nš File Type Distribution:");
|
|
211
|
+
const headers = ["Type", "Count", "Size", "Percentage"];
|
|
212
|
+
const rows = result.fileTypes.map((type) => [
|
|
213
|
+
type.extension || "no-extension",
|
|
214
|
+
formatNumber(type.count),
|
|
215
|
+
formatBytes(type.totalSize),
|
|
216
|
+
formatPercentage(type.percentage, 100),
|
|
217
|
+
]);
|
|
218
|
+
|
|
219
|
+
logger.log(formatTable(headers, rows));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private reportMonorepoAnalysis(result: MonorepoAnalysisResult): void {
|
|
224
|
+
logger.log("\nšļø Monorepo Analysis Results");
|
|
225
|
+
logger.log("ā".repeat(40));
|
|
226
|
+
|
|
227
|
+
// Summary
|
|
228
|
+
logger.log(`Packages: ${formatNumber(result.packages.length)}`);
|
|
229
|
+
logger.log(
|
|
230
|
+
`Dependencies: ${formatNumber(result.dependencies.edges.length)}`,
|
|
231
|
+
);
|
|
232
|
+
logger.log(`Circular Dependencies: ${result.circularDependencies.length}`);
|
|
233
|
+
logger.log(`Suggested Concurrency: ${result.suggestedConcurrency}`);
|
|
234
|
+
|
|
235
|
+
// Build order
|
|
236
|
+
if (result.buildOrder.length > 0) {
|
|
237
|
+
logger.log("\nš Build Order:");
|
|
238
|
+
const levels = result.dependencies.levels;
|
|
239
|
+
for (let i = 0; i < levels.length; i++) {
|
|
240
|
+
const level = levels[i]!;
|
|
241
|
+
logger.log(` Level ${i + 1}: ${level.join(", ")}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Critical path
|
|
246
|
+
if (result.criticalPath.length > 0) {
|
|
247
|
+
logger.log("\nšÆ Critical Path:");
|
|
248
|
+
logger.log(` ${result.criticalPath.slice(0, 10).join(" ā ")}`);
|
|
249
|
+
if (result.criticalPath.length > 10) {
|
|
250
|
+
logger.log(` ... and ${result.criticalPath.length - 10} more`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Circular dependencies
|
|
255
|
+
if (result.circularDependencies.length > 0) {
|
|
256
|
+
logger.log("\nš Circular Dependencies:");
|
|
257
|
+
for (const circular of result.circularDependencies) {
|
|
258
|
+
logger.log(
|
|
259
|
+
` ${formatSeverity(circular.severity)} ${circular.cycle.join(" ā ")}`,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Bottlenecks
|
|
265
|
+
if (result.bottlenecks.length > 0) {
|
|
266
|
+
logger.log("\nā ļø Bottlenecks:");
|
|
267
|
+
const headers = ["Package", "Type", "Impact", "Suggestion"];
|
|
268
|
+
const rows = result.bottlenecks.map((bottleneck) => [
|
|
269
|
+
bottleneck.package,
|
|
270
|
+
formatBottleneckType(bottleneck.type),
|
|
271
|
+
bottleneck.impact.toString(),
|
|
272
|
+
bottleneck.suggestion,
|
|
273
|
+
]);
|
|
274
|
+
|
|
275
|
+
logger.log(formatTable(headers, rows));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Package details (if verbose)
|
|
279
|
+
if (this.verbose) {
|
|
280
|
+
logger.log("\nš¦ Package Details:");
|
|
281
|
+
const headers = ["Package", "Dependencies", "Dependents", "Type"];
|
|
282
|
+
const rows = result.packages.map((pkg) => [
|
|
283
|
+
pkg.name,
|
|
284
|
+
pkg.dependencies.length.toString(),
|
|
285
|
+
pkg.dependents.length.toString(),
|
|
286
|
+
pkg.dependencies.length > 10 ? "Heavy" : "Light",
|
|
287
|
+
]);
|
|
288
|
+
|
|
289
|
+
logger.log(formatTable(headers, rows));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
private reportBaselineComparison(baseline: PerfReport["baseline"]): void {
|
|
294
|
+
if (!baseline?.exists) return;
|
|
295
|
+
|
|
296
|
+
logger.log("\nš Baseline Comparison");
|
|
297
|
+
logger.log("ā".repeat(40));
|
|
298
|
+
|
|
299
|
+
if (baseline.improvement !== undefined) {
|
|
300
|
+
logger.log(
|
|
301
|
+
`Performance: ${formatRelativeChange(0, baseline.improvement)}`,
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (baseline.regression !== undefined) {
|
|
306
|
+
logger.log(
|
|
307
|
+
`Performance: ${formatRelativeChange(0, -baseline.regression)}`,
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (baseline.changes) {
|
|
312
|
+
const changes = baseline.changes;
|
|
313
|
+
if (changes.duration !== undefined) {
|
|
314
|
+
logger.log(`Duration: ${formatRelativeChange(0, changes.duration)}`);
|
|
315
|
+
}
|
|
316
|
+
if (changes.memory !== undefined) {
|
|
317
|
+
logger.log(`Memory: ${formatRelativeChange(0, changes.memory)}`);
|
|
318
|
+
}
|
|
319
|
+
if (changes.size !== undefined) {
|
|
320
|
+
logger.log(`Size: ${formatRelativeChange(0, changes.size)}`);
|
|
321
|
+
}
|
|
322
|
+
if (changes.files !== undefined) {
|
|
323
|
+
logger.log(`Files: ${formatRelativeChange(0, changes.files)}`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const createConsoleReporter = (verbose = false): ConsoleReporter => {
|
|
330
|
+
return new ConsoleReporter(verbose);
|
|
331
|
+
};
|