@decaf-ts/utils 0.11.8 → 0.11.10
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/README.md +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/tests/index.d.ts +1 -0
- package/lib/esm/tests/index.js +1 -0
- package/lib/esm/tests/index.js.map +1 -1
- package/lib/esm/tests/jestPerformanceRunner.d.ts +7 -0
- package/lib/esm/tests/jestPerformanceRunner.js +15 -0
- package/lib/esm/tests/jestPerformanceRunner.js.map +1 -0
- package/lib/esm/utils/index.d.ts +1 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/esm/utils/performanceRunner.d.ts +126 -0
- package/lib/esm/utils/performanceRunner.js +344 -0
- package/lib/esm/utils/performanceRunner.js.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/tests/index.cjs +1 -0
- package/lib/tests/index.d.ts +1 -0
- package/lib/tests/index.js.map +1 -1
- package/lib/tests/jestPerformanceRunner.cjs +19 -0
- package/lib/tests/jestPerformanceRunner.d.ts +7 -0
- package/lib/tests/jestPerformanceRunner.js.map +1 -0
- package/lib/utils/index.cjs +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/performanceRunner.cjs +384 -0
- package/lib/utils/performanceRunner.d.ts +126 -0
- package/lib/utils/performanceRunner.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PerformanceRunner = exports.defaultCanvasOptions = void 0;
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const promises_1 = require("fs/promises");
|
|
42
|
+
const logging_1 = require("@decaf-ts/logging");
|
|
43
|
+
exports.defaultCanvasOptions = {
|
|
44
|
+
width: 1200,
|
|
45
|
+
height: 260,
|
|
46
|
+
padding: 32,
|
|
47
|
+
backgroundColor: "#0f172a",
|
|
48
|
+
headerFont: "bold 18px 'Segoe UI', sans-serif",
|
|
49
|
+
rowFont: "14px 'Segoe UI', sans-serif",
|
|
50
|
+
headerColor: "#f8fafc",
|
|
51
|
+
rowColor: "#cbd5f5",
|
|
52
|
+
};
|
|
53
|
+
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
54
|
+
const perfDebugEnabled = process.env.PERF_VERBOSE === "true";
|
|
55
|
+
const debugLog = (...args) => {
|
|
56
|
+
if (perfDebugEnabled) {
|
|
57
|
+
console.debug(...args);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const formatTable = (title, headers, rows) => {
|
|
61
|
+
const columnWidths = headers.map((header, index) => Math.max(header.length, ...rows.map((row) => row[index]?.length ?? 0)));
|
|
62
|
+
const formatRow = (values) => "| " +
|
|
63
|
+
values
|
|
64
|
+
.map((value, index) => value.padEnd(columnWidths[index]))
|
|
65
|
+
.join(" | ") +
|
|
66
|
+
" |";
|
|
67
|
+
const headerLine = formatRow(headers);
|
|
68
|
+
const divider = "| " + columnWidths.map((width) => "-".repeat(width)).join(" | ") + " |";
|
|
69
|
+
const body = rows.map(formatRow).join("\n");
|
|
70
|
+
return `${title}\n${headerLine}\n${divider}\n${body}`;
|
|
71
|
+
};
|
|
72
|
+
const ensureDirectory = async (targetPath) => {
|
|
73
|
+
await (0, promises_1.mkdir)(path_1.default.dirname(targetPath), { recursive: true });
|
|
74
|
+
};
|
|
75
|
+
const renderMetricsTableToCanvas = async (headers, rows, options, outputPath) => {
|
|
76
|
+
const config = { ...exports.defaultCanvasOptions, ...options };
|
|
77
|
+
// @ts-expect-error canvas import
|
|
78
|
+
let createCanvas;
|
|
79
|
+
try {
|
|
80
|
+
// @ts-expect-error because we allow optional dependency
|
|
81
|
+
const canvasModule = await Promise.resolve().then(() => __importStar(require("canvas")));
|
|
82
|
+
createCanvas = canvasModule.createCanvas;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.warn("[PerfRunner] Canvas module not available, skipping chart.", error);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const canvas = createCanvas(config.width, config.height);
|
|
89
|
+
const ctx = canvas.getContext("2d");
|
|
90
|
+
ctx.fillStyle = config.backgroundColor;
|
|
91
|
+
ctx.fillRect(0, 0, config.width, config.height);
|
|
92
|
+
ctx.font = config.headerFont;
|
|
93
|
+
ctx.fillStyle = config.headerColor;
|
|
94
|
+
const columnWidth = (config.width - config.padding * 2) / headers.length;
|
|
95
|
+
const headerY = config.padding + 24;
|
|
96
|
+
headers.forEach((header, index) => {
|
|
97
|
+
ctx.fillText(header, config.padding + columnWidth * index, headerY);
|
|
98
|
+
});
|
|
99
|
+
ctx.font = config.rowFont;
|
|
100
|
+
ctx.fillStyle = config.rowColor;
|
|
101
|
+
const rowHeight = 24;
|
|
102
|
+
rows.forEach((row, rowIndex) => {
|
|
103
|
+
const y = headerY + 12 + rowHeight * (rowIndex + 1);
|
|
104
|
+
row.forEach((cell, cellIndex) => {
|
|
105
|
+
ctx.fillText(cell, config.padding + columnWidth * cellIndex, y);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
await ensureDirectory(outputPath);
|
|
109
|
+
await (0, promises_1.writeFile)(outputPath, canvas.toBuffer("image/png"));
|
|
110
|
+
console.log(`Stored performance chart at ${outputPath}`);
|
|
111
|
+
};
|
|
112
|
+
class PerformanceRunner {
|
|
113
|
+
constructor(scenario) {
|
|
114
|
+
this.scenario = scenario;
|
|
115
|
+
}
|
|
116
|
+
async run() {
|
|
117
|
+
if (this.scenario.initialize) {
|
|
118
|
+
await this.scenario.initialize();
|
|
119
|
+
}
|
|
120
|
+
let phaseCounter = 0;
|
|
121
|
+
const queue = this.scenario.phases.map((phase) => ({ phase, phaseNumber: ++phaseCounter }));
|
|
122
|
+
const results = [];
|
|
123
|
+
while (queue.length) {
|
|
124
|
+
const item = queue.shift();
|
|
125
|
+
const phase = item.phase;
|
|
126
|
+
const context = this.mergeContext(phase);
|
|
127
|
+
console.info(`[PerfRunner] Starting phase #${item.phaseNumber} "${phase.name}"`, {
|
|
128
|
+
iterations: phase.config.iterations,
|
|
129
|
+
mode: phase.config.mode,
|
|
130
|
+
concurrency: phase.config.concurrency,
|
|
131
|
+
burst: phase.config.burst,
|
|
132
|
+
});
|
|
133
|
+
const result = await this.runPhase(phase, context);
|
|
134
|
+
console.info(`[PerfRunner] Completed phase #${item.phaseNumber} "${phase.name}"`, {
|
|
135
|
+
total: result.aggregated.totalDurationMs.toFixed(2),
|
|
136
|
+
avg: result.aggregated.averageMs.toFixed(2),
|
|
137
|
+
failureCount: result.aggregated.failureCount,
|
|
138
|
+
});
|
|
139
|
+
results.push(result);
|
|
140
|
+
if (phase.generator) {
|
|
141
|
+
const historySnapshot = [...results];
|
|
142
|
+
const metadata = {
|
|
143
|
+
phaseNumber: item.phaseNumber,
|
|
144
|
+
phaseName: phase.name,
|
|
145
|
+
iterationCount: phase.config.iterations,
|
|
146
|
+
burstSegments: result.segmentCount,
|
|
147
|
+
segmentCount: result.segmentCount,
|
|
148
|
+
mode: phase.config.mode,
|
|
149
|
+
history: historySnapshot,
|
|
150
|
+
};
|
|
151
|
+
const generatorResult = await phase.generator({
|
|
152
|
+
result,
|
|
153
|
+
history: historySnapshot,
|
|
154
|
+
metadata,
|
|
155
|
+
});
|
|
156
|
+
if (generatorResult) {
|
|
157
|
+
const nextPhase = ("config" in generatorResult
|
|
158
|
+
? {
|
|
159
|
+
name: generatorResult.name ?? `${phase.name} → gen`,
|
|
160
|
+
config: generatorResult.config,
|
|
161
|
+
generator: phase.generator,
|
|
162
|
+
}
|
|
163
|
+
: {
|
|
164
|
+
name: `${phase.name} → gen`,
|
|
165
|
+
config: generatorResult,
|
|
166
|
+
generator: phase.generator,
|
|
167
|
+
});
|
|
168
|
+
queue.push({
|
|
169
|
+
phase: nextPhase,
|
|
170
|
+
phaseNumber: ++phaseCounter,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
await this.logSummary(results);
|
|
176
|
+
return results;
|
|
177
|
+
}
|
|
178
|
+
async runPhase(phase, context) {
|
|
179
|
+
await this.runWarmup(phase, context);
|
|
180
|
+
const segments = this.buildSegmentIndices(phase.config.iterations, phase.config.burst);
|
|
181
|
+
const collected = [];
|
|
182
|
+
for (let segmentIndex = 0; segmentIndex < segments.length; segmentIndex += 1) {
|
|
183
|
+
const indices = segments[segmentIndex];
|
|
184
|
+
if (!indices.length) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
debugLog(`[PerfRunner] Phase "${phase.name}" executing segment ${segmentIndex + 1}/${segments.length} (iterations ${indices[0]}-${indices[indices.length - 1]})`);
|
|
188
|
+
const metrics = await this.executeSegment(this.scenario.handler, phase.config, context, indices);
|
|
189
|
+
collected.push(...metrics);
|
|
190
|
+
const burstInterval = phase.config.burst?.intervalMs;
|
|
191
|
+
if (burstInterval && segmentIndex < segments.length - 1) {
|
|
192
|
+
await delay(burstInterval);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const sorted = [...collected].sort((a, b) => a.iteration - b.iteration);
|
|
196
|
+
const aggregated = this.aggregateMetrics(sorted);
|
|
197
|
+
if (phase.config.pauseAfterMs) {
|
|
198
|
+
await delay(phase.config.pauseAfterMs);
|
|
199
|
+
}
|
|
200
|
+
if (aggregated.failureCount > 0 && this.scenario.failOnError !== false) {
|
|
201
|
+
throw new Error(`Phase ${phase.name} recorded ${aggregated.failureCount} failures`);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
phase,
|
|
205
|
+
config: phase.config,
|
|
206
|
+
iterationMetrics: sorted,
|
|
207
|
+
aggregated,
|
|
208
|
+
context,
|
|
209
|
+
segmentCount: segments.length,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
async runWarmup(phase, context) {
|
|
213
|
+
const warmup = phase.config.warmup;
|
|
214
|
+
if (!warmup?.iterations) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const handler = warmup.handler ?? this.scenario.handler;
|
|
218
|
+
for (let index = 0; index < warmup.iterations; index += 1) {
|
|
219
|
+
await handler({
|
|
220
|
+
iteration: index,
|
|
221
|
+
config: phase.config,
|
|
222
|
+
loadFactor: this.computeLoadFactor(phase.config, index),
|
|
223
|
+
context,
|
|
224
|
+
});
|
|
225
|
+
if (warmup.delayBetweenIterationsMs && index < warmup.iterations - 1) {
|
|
226
|
+
await delay(warmup.delayBetweenIterationsMs);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
computeLoadFactor(config, iteration) {
|
|
231
|
+
const base = config.loadStart ?? 1;
|
|
232
|
+
const step = config.loadStep ?? 0;
|
|
233
|
+
const multiplier = config.loadMultiplier ?? 1;
|
|
234
|
+
return (base + step * iteration) * multiplier;
|
|
235
|
+
}
|
|
236
|
+
buildSegmentIndices(iterations, burst) {
|
|
237
|
+
const total = Math.max(0, iterations);
|
|
238
|
+
if (total === 0) {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
const chunk = burst?.size && burst.size > 0 ? Math.min(burst.size, total) : total;
|
|
242
|
+
const segments = [];
|
|
243
|
+
for (let cursor = 0; cursor < total; cursor += chunk) {
|
|
244
|
+
const end = Math.min(total, cursor + chunk);
|
|
245
|
+
segments.push(Array.from({ length: end - cursor }, (_, idx) => cursor + idx));
|
|
246
|
+
}
|
|
247
|
+
return segments;
|
|
248
|
+
}
|
|
249
|
+
mergeContext(phase) {
|
|
250
|
+
const baseContext = this.scenario.baseContext ?? {};
|
|
251
|
+
const phaseContext = phase.config.context ?? {};
|
|
252
|
+
return this.mergeContexts(baseContext, phaseContext);
|
|
253
|
+
}
|
|
254
|
+
mergeContexts(a, b) {
|
|
255
|
+
return Object.assign({}, a, b);
|
|
256
|
+
}
|
|
257
|
+
async executeSegment(handler, config, context, indices) {
|
|
258
|
+
if (!indices.length) {
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
if (config.mode === "concurrent") {
|
|
262
|
+
return this.collectConcurrent(handler, config, context, indices);
|
|
263
|
+
}
|
|
264
|
+
return this.collectSequential(handler, config, context, indices);
|
|
265
|
+
}
|
|
266
|
+
async collectSequential(handler, config, context, indices) {
|
|
267
|
+
const metrics = [];
|
|
268
|
+
const delayBetween = config.delayBetweenIterationsMs;
|
|
269
|
+
for (let idx = 0; idx < indices.length; idx += 1) {
|
|
270
|
+
metrics.push(await this.runIteration(handler, config, context, indices[idx]));
|
|
271
|
+
if (delayBetween && idx < indices.length - 1) {
|
|
272
|
+
await delay(delayBetween);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return metrics;
|
|
276
|
+
}
|
|
277
|
+
async collectConcurrent(handler, config, context, indices) {
|
|
278
|
+
const concurrency = Math.max(1, Math.min(config.concurrency ?? indices.length, indices.length));
|
|
279
|
+
const metrics = [];
|
|
280
|
+
let pointer = 0;
|
|
281
|
+
const worker = async () => {
|
|
282
|
+
while (pointer < indices.length) {
|
|
283
|
+
const iteration = indices[pointer];
|
|
284
|
+
pointer += 1;
|
|
285
|
+
metrics.push(await this.runIteration(handler, config, context, iteration));
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
await Promise.all(Array.from({ length: concurrency }, () => worker()));
|
|
289
|
+
return metrics;
|
|
290
|
+
}
|
|
291
|
+
async runIteration(handler, config, context, iteration) {
|
|
292
|
+
const loadFactor = this.computeLoadFactor(config, iteration);
|
|
293
|
+
const stopwatch = new logging_1.StopWatch(true);
|
|
294
|
+
let success = true;
|
|
295
|
+
let meta;
|
|
296
|
+
debugLog(`[PerfRunner] Iteration ${iteration} (phase=${config.metadata?.phaseName ?? "n/a"}, load=${loadFactor.toFixed(2)}) starting`);
|
|
297
|
+
try {
|
|
298
|
+
const result = await handler({ iteration, config, loadFactor, context });
|
|
299
|
+
if (typeof result?.success === "boolean") {
|
|
300
|
+
success = result.success;
|
|
301
|
+
}
|
|
302
|
+
meta = result?.meta;
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
success = false;
|
|
306
|
+
meta = { error: error instanceof Error ? error.message : String(error) };
|
|
307
|
+
}
|
|
308
|
+
const durationMs = stopwatch.stop();
|
|
309
|
+
debugLog(`[PerfRunner] Iteration ${iteration} complete in ${durationMs.toFixed(2)}ms, success=${success}`);
|
|
310
|
+
return { iteration, durationMs, success, meta, loadFactor };
|
|
311
|
+
}
|
|
312
|
+
aggregateMetrics(metrics) {
|
|
313
|
+
if (metrics.length === 0) {
|
|
314
|
+
return {
|
|
315
|
+
totalDurationMs: 0,
|
|
316
|
+
minMs: 0,
|
|
317
|
+
maxMs: 0,
|
|
318
|
+
averageMs: 0,
|
|
319
|
+
successCount: 0,
|
|
320
|
+
failureCount: 0,
|
|
321
|
+
loadStart: 0,
|
|
322
|
+
loadEnd: 0,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
const totalDurationMs = metrics.reduce((acc, metric) => acc + metric.durationMs, 0);
|
|
326
|
+
const minMs = Math.min(...metrics.map((metric) => metric.durationMs));
|
|
327
|
+
const maxMs = Math.max(...metrics.map((metric) => metric.durationMs));
|
|
328
|
+
const averageMs = totalDurationMs / metrics.length;
|
|
329
|
+
const successCount = metrics.filter((metric) => metric.success).length;
|
|
330
|
+
const failureCount = metrics.length - successCount;
|
|
331
|
+
const loadStart = metrics[0]?.loadFactor ?? 0;
|
|
332
|
+
const loadEnd = metrics[metrics.length - 1]?.loadFactor ?? loadStart;
|
|
333
|
+
return {
|
|
334
|
+
totalDurationMs,
|
|
335
|
+
minMs,
|
|
336
|
+
maxMs,
|
|
337
|
+
averageMs,
|
|
338
|
+
successCount,
|
|
339
|
+
failureCount,
|
|
340
|
+
loadStart,
|
|
341
|
+
loadEnd,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
async logSummary(results) {
|
|
345
|
+
if (!results.length) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const headers = [
|
|
349
|
+
"Phase",
|
|
350
|
+
"Mode",
|
|
351
|
+
"Iterations",
|
|
352
|
+
"Total ms",
|
|
353
|
+
"Avg ms",
|
|
354
|
+
"Min ms",
|
|
355
|
+
"Max ms",
|
|
356
|
+
"Success",
|
|
357
|
+
"Failures",
|
|
358
|
+
"Load range",
|
|
359
|
+
];
|
|
360
|
+
const rows = results.map((result) => [
|
|
361
|
+
result.phase.name,
|
|
362
|
+
result.config.mode,
|
|
363
|
+
result.config.iterations.toString(),
|
|
364
|
+
result.aggregated.totalDurationMs.toFixed(2),
|
|
365
|
+
result.aggregated.averageMs.toFixed(2),
|
|
366
|
+
result.aggregated.minMs.toFixed(2),
|
|
367
|
+
result.aggregated.maxMs.toFixed(2),
|
|
368
|
+
result.aggregated.successCount.toString(),
|
|
369
|
+
result.aggregated.failureCount.toString(),
|
|
370
|
+
`${result.aggregated.loadStart.toFixed(2)} → ${result.aggregated.loadEnd.toFixed(2)}`,
|
|
371
|
+
]);
|
|
372
|
+
console.log(formatTable(`Performance summary for ${this.scenario.name}`, headers, rows));
|
|
373
|
+
if (this.shouldRenderCanvas()) {
|
|
374
|
+
const chartPath = this.scenario.canvasOutputPath ??
|
|
375
|
+
path_1.default.join(process.cwd(), "workdocs", "reports", "performance-runner.png");
|
|
376
|
+
await renderMetricsTableToCanvas(headers, rows, this.scenario.canvasOptions ?? exports.defaultCanvasOptions, chartPath);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
shouldRenderCanvas() {
|
|
380
|
+
return this.scenario.enableCanvas ?? Boolean(this.scenario.canvasOptions);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
exports.PerformanceRunner = PerformanceRunner;
|
|
384
|
+
//# sourceMappingURL=performanceRunner.js.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export type ExecutionMode = "sequential" | "concurrent" | "burst";
|
|
2
|
+
export interface PhaseBurstConfig {
|
|
3
|
+
size: number;
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PhaseWarmupConfig<TContext = Record<string, unknown>> {
|
|
7
|
+
iterations: number;
|
|
8
|
+
handler?: PerformanceHandler<TContext>;
|
|
9
|
+
delayBetweenIterationsMs?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PhaseConfig<TContext = Record<string, unknown>> {
|
|
12
|
+
iterations: number;
|
|
13
|
+
mode: ExecutionMode;
|
|
14
|
+
concurrency?: number;
|
|
15
|
+
delayBetweenIterationsMs?: number;
|
|
16
|
+
burst?: PhaseBurstConfig;
|
|
17
|
+
loadStart?: number;
|
|
18
|
+
loadStep?: number;
|
|
19
|
+
loadMultiplier?: number;
|
|
20
|
+
context?: Partial<TContext>;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
warmup?: PhaseWarmupConfig<TContext>;
|
|
23
|
+
pauseAfterMs?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface Phase<TContext = Record<string, unknown>> {
|
|
26
|
+
name: string;
|
|
27
|
+
config: PhaseConfig<TContext>;
|
|
28
|
+
generator?: PhaseGenerator<TContext>;
|
|
29
|
+
subPhases?: Phase<TContext>[];
|
|
30
|
+
}
|
|
31
|
+
export interface PhaseGeneratorPhase<TContext> {
|
|
32
|
+
name?: string;
|
|
33
|
+
config: PhaseConfig<Partial<TContext>>;
|
|
34
|
+
}
|
|
35
|
+
export type PhaseGeneratorResult<TContext> = PhaseConfig<TContext> | PhaseGeneratorPhase<TContext>;
|
|
36
|
+
export type PhaseGenerator<TContext> = (payload: PhaseGeneratorPayload<TContext>) => Promise<PhaseGeneratorResult<TContext> | undefined> | PhaseGeneratorResult<TContext> | undefined;
|
|
37
|
+
export interface PhaseResult<TContext = Record<string, unknown>> {
|
|
38
|
+
phase: Phase<TContext>;
|
|
39
|
+
config: PhaseConfig<TContext>;
|
|
40
|
+
iterationMetrics: IterationMetric[];
|
|
41
|
+
aggregated: AggregatedMetrics;
|
|
42
|
+
context: TContext;
|
|
43
|
+
segmentCount: number;
|
|
44
|
+
}
|
|
45
|
+
export interface PhaseGeneratorMetadata<TContext = Record<string, unknown>> {
|
|
46
|
+
phaseNumber: number;
|
|
47
|
+
phaseName: string;
|
|
48
|
+
iterationCount: number;
|
|
49
|
+
burstSegments: number;
|
|
50
|
+
segmentCount: number;
|
|
51
|
+
mode: ExecutionMode;
|
|
52
|
+
history: PhaseResult<TContext>[];
|
|
53
|
+
}
|
|
54
|
+
export interface PhaseGeneratorPayload<TContext = Record<string, unknown>> {
|
|
55
|
+
result: PhaseResult<TContext>;
|
|
56
|
+
history: PhaseResult<TContext>[];
|
|
57
|
+
metadata: PhaseGeneratorMetadata<TContext>;
|
|
58
|
+
}
|
|
59
|
+
export interface AggregatedMetrics {
|
|
60
|
+
totalDurationMs: number;
|
|
61
|
+
minMs: number;
|
|
62
|
+
maxMs: number;
|
|
63
|
+
averageMs: number;
|
|
64
|
+
successCount: number;
|
|
65
|
+
failureCount: number;
|
|
66
|
+
loadStart: number;
|
|
67
|
+
loadEnd: number;
|
|
68
|
+
}
|
|
69
|
+
export interface IterationMetric {
|
|
70
|
+
iteration: number;
|
|
71
|
+
durationMs: number;
|
|
72
|
+
success: boolean;
|
|
73
|
+
meta?: Record<string, unknown>;
|
|
74
|
+
loadFactor: number;
|
|
75
|
+
}
|
|
76
|
+
export interface HandlerPayload<TContext = Record<string, unknown>> {
|
|
77
|
+
iteration: number;
|
|
78
|
+
config: PhaseConfig<TContext>;
|
|
79
|
+
loadFactor: number;
|
|
80
|
+
context: TContext;
|
|
81
|
+
}
|
|
82
|
+
export interface HandlerResult {
|
|
83
|
+
success?: boolean;
|
|
84
|
+
meta?: Record<string, unknown>;
|
|
85
|
+
}
|
|
86
|
+
export type PerformanceHandler<TContext = Record<string, unknown>> = (payload: HandlerPayload<TContext>) => Promise<HandlerResult> | HandlerResult;
|
|
87
|
+
export interface CanvasRenderOptions {
|
|
88
|
+
width?: number;
|
|
89
|
+
height?: number;
|
|
90
|
+
padding?: number;
|
|
91
|
+
backgroundColor?: string;
|
|
92
|
+
headerFont?: string;
|
|
93
|
+
rowFont?: string;
|
|
94
|
+
headerColor?: string;
|
|
95
|
+
rowColor?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PerformanceScenario<TContext = Record<string, unknown>> {
|
|
98
|
+
name: string;
|
|
99
|
+
handler: PerformanceHandler<TContext>;
|
|
100
|
+
phases: Phase<TContext>[];
|
|
101
|
+
baseContext?: TContext;
|
|
102
|
+
failOnError?: boolean;
|
|
103
|
+
initialize?: () => Promise<void> | void;
|
|
104
|
+
canvasOptions?: CanvasRenderOptions;
|
|
105
|
+
canvasOutputPath?: string;
|
|
106
|
+
enableCanvas?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export declare const defaultCanvasOptions: Required<CanvasRenderOptions>;
|
|
109
|
+
export declare class PerformanceRunner<TContext = Record<string, unknown>> {
|
|
110
|
+
protected readonly scenario: PerformanceScenario<TContext>;
|
|
111
|
+
constructor(scenario: PerformanceScenario<TContext>);
|
|
112
|
+
run(): Promise<PhaseResult<TContext>[]>;
|
|
113
|
+
protected runPhase(phase: Phase<TContext>, context: TContext): Promise<PhaseResult<TContext>>;
|
|
114
|
+
protected runWarmup(phase: Phase<TContext>, context: TContext): Promise<void>;
|
|
115
|
+
protected computeLoadFactor(config: PhaseConfig<TContext>, iteration: number): number;
|
|
116
|
+
protected buildSegmentIndices(iterations: number, burst?: PhaseBurstConfig): number[][];
|
|
117
|
+
protected mergeContext(phase: Phase<TContext>): TContext;
|
|
118
|
+
protected mergeContexts(a: TContext, b: Partial<TContext>): TContext;
|
|
119
|
+
protected executeSegment(handler: PerformanceHandler<TContext>, config: PhaseConfig<TContext>, context: TContext, indices: number[]): Promise<IterationMetric[]>;
|
|
120
|
+
protected collectSequential(handler: PerformanceHandler<TContext>, config: PhaseConfig<TContext>, context: TContext, indices: number[]): Promise<IterationMetric[]>;
|
|
121
|
+
protected collectConcurrent(handler: PerformanceHandler<TContext>, config: PhaseConfig<TContext>, context: TContext, indices: number[]): Promise<IterationMetric[]>;
|
|
122
|
+
protected runIteration(handler: PerformanceHandler<TContext>, config: PhaseConfig<TContext>, context: TContext, iteration: number): Promise<IterationMetric>;
|
|
123
|
+
protected aggregateMetrics(metrics: IterationMetric[]): AggregatedMetrics;
|
|
124
|
+
protected logSummary(results: PhaseResult<TContext>[]): Promise<void>;
|
|
125
|
+
protected shouldRenderCanvas(): boolean;
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performanceRunner.js","sourceRoot":"","sources":["../../src/utils/performanceRunner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,0CAA+C;AAC/C,+CAA8C;AA6IjC,QAAA,oBAAoB,GAAkC;IACjE,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,EAAE;IACX,eAAe,EAAE,SAAS;IAC1B,UAAU,EAAE,kCAAkC;IAC9C,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAChF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,MAAM,CAAC;AAC7D,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;IACtC,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,KAAa,EACb,OAAiB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|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.10",
|
|
4
4
|
"description": "module management utils for decaf-ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"prettier": "3.5.3",
|
|
127
127
|
"prompts": "^2.4.2",
|
|
128
128
|
"rimraf": "^6.0.1",
|
|
129
|
-
"rollup": "^
|
|
129
|
+
"rollup": "^4.0.0",
|
|
130
130
|
"shell-quote": "^1.8.3",
|
|
131
131
|
"styled-string-builder": "latest",
|
|
132
132
|
"ts-jest": "^29.3.2",
|