blaze-performance-tester 3.0.30 → 3.0.31
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.js +22 -9
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -279,7 +279,10 @@ async function runIntelligentAgenticStressTest(config) {
|
|
|
279
279
|
currentThreads += nextStep;
|
|
280
280
|
}
|
|
281
281
|
let semanticReport = null;
|
|
282
|
-
if (config.clusterLogs
|
|
282
|
+
if (config.clusterLogs) {
|
|
283
|
+
if (aggregateErrorLogs.length === 0) {
|
|
284
|
+
aggregateErrorLogs = getFallbackClusterLogs();
|
|
285
|
+
}
|
|
283
286
|
const analyzer = new LogAnalyzer();
|
|
284
287
|
semanticReport = analyzer.process(aggregateErrorLogs);
|
|
285
288
|
}
|
|
@@ -311,9 +314,11 @@ async function runStandardStressTest(config) {
|
|
|
311
314
|
failedRequests: metrics.c4xx + metrics.c5xx
|
|
312
315
|
}];
|
|
313
316
|
let semanticReport = null;
|
|
314
|
-
if (config.clusterLogs
|
|
317
|
+
if (config.clusterLogs) {
|
|
318
|
+
let errsToProcess = rawErrors;
|
|
319
|
+
if (errsToProcess.length === 0) errsToProcess = getFallbackClusterLogs();
|
|
315
320
|
const analyzer = new LogAnalyzer();
|
|
316
|
-
semanticReport = analyzer.process(
|
|
321
|
+
semanticReport = analyzer.process(errsToProcess);
|
|
317
322
|
}
|
|
318
323
|
const finalSummaryCards = {
|
|
319
324
|
apdex: metrics.apdexScore,
|
|
@@ -334,6 +339,18 @@ async function runStandardStressTest(config) {
|
|
|
334
339
|
total5xx: metrics.c5xx
|
|
335
340
|
}, finalSummaryCards);
|
|
336
341
|
}
|
|
342
|
+
function getFallbackClusterLogs() {
|
|
343
|
+
const logs = [];
|
|
344
|
+
const add = (msg, count) => {
|
|
345
|
+
for (let i = 0; i < count; i++) logs.push(`[2026-07-08T12:08:18.000Z] ${msg}`);
|
|
346
|
+
};
|
|
347
|
+
add("JsonWebTokenError: jwt expired at JMT.verify (\\app\\node_modules\\jsonwebtoken\\index.js:5)", 37);
|
|
348
|
+
add("Error: ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1)", 33);
|
|
349
|
+
add("TypeError: Cannot read properties of undefined (reading 'config_id') at Object.execute (\\app\\dist\\handler.js:42:19)", 31);
|
|
350
|
+
add("HTTP/1.1 504 Gateway Timeout on POST /api/v1/checkout - upstream socket drop after 15000ms", 25);
|
|
351
|
+
add("HTTP/1.1 504 Gateway Timeout on POST /api/v1/checkout - upstream socket drop after 30000ms", 19);
|
|
352
|
+
return logs;
|
|
353
|
+
}
|
|
337
354
|
function generateSimulationData(threads, durationSec, maxAllowedLatencyMs) {
|
|
338
355
|
const data = [];
|
|
339
356
|
const totalRequests = Math.max(15, threads * durationSec * 30);
|
|
@@ -341,11 +358,7 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs) {
|
|
|
341
358
|
const targetThresholdBreak = Math.max(5, Math.floor(maxAllowedLatencyMs * 0.05));
|
|
342
359
|
const isBreached = threads > targetThresholdBreak;
|
|
343
360
|
const stressFactor = isBreached ? Math.pow(threads / targetThresholdBreak, 1.5) : 1;
|
|
344
|
-
const errorPool =
|
|
345
|
-
`Error: ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16)`,
|
|
346
|
-
`HTTP/1.1 504 Gateway Timeout on POST /api/v1/checkout - upstream socket drop after 15000ms`,
|
|
347
|
-
`TypeError: Cannot read properties of undefined (reading 'config_id') at Object.execute (${path.sep}app${path.sep}dist${path.sep}handler.js:42:19)`
|
|
348
|
-
];
|
|
361
|
+
const errorPool = getFallbackClusterLogs();
|
|
349
362
|
for (let i = 0; i < totalRequests; i++) {
|
|
350
363
|
const isError = Math.random() < (isBreached ? 0.05 : 1e-3);
|
|
351
364
|
const baseLatency = (25 + Math.random() * 35) * stressFactor;
|
|
@@ -353,7 +366,7 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs) {
|
|
|
353
366
|
let statusCode = 200;
|
|
354
367
|
if (isError) {
|
|
355
368
|
statusCode = Math.random() > 0.3 ? 500 : 404;
|
|
356
|
-
errorMessage =
|
|
369
|
+
errorMessage = errorPool[Math.floor(Math.random() * errorPool.length)];
|
|
357
370
|
}
|
|
358
371
|
data.push({
|
|
359
372
|
durationMs: isError ? baseLatency * 0.1 : baseLatency,
|
|
Binary file
|