blaze-performance-tester 3.2.5 → 3.2.7
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 +42 -97
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env ts-node
|
|
2
|
-
|
|
3
1
|
// cli.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import yargs from "yargs";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
4
6
|
import { createRequire } from "module";
|
|
5
|
-
import * as path from "path";
|
|
6
7
|
import { fileURLToPath } from "url";
|
|
7
|
-
import * as fs from "fs";
|
|
8
8
|
|
|
9
9
|
// src/LogAnalyzer.ts
|
|
10
10
|
var LogAnalyzer = class {
|
|
@@ -370,99 +370,6 @@ async function executeTestPipeline(config) {
|
|
|
370
370
|
console.log("Pipeline run complete. Parameter tracking successfully mitigated breaking changes.");
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
async function main() {
|
|
374
|
-
const args = process.argv.slice(2);
|
|
375
|
-
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
376
|
-
printUsage();
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const config = parseArguments(args);
|
|
380
|
-
if (config.isCorrelate || config.nlpPrompt) {
|
|
381
|
-
await executeTestPipeline(config);
|
|
382
|
-
}
|
|
383
|
-
if (config.isAgentic) {
|
|
384
|
-
await runIntelligentAgenticStressTest(config);
|
|
385
|
-
} else {
|
|
386
|
-
await runStandardStressTest(config);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
function parseArguments(args) {
|
|
390
|
-
const targetScript = path.resolve(args[0] || ".");
|
|
391
|
-
const isAgentic = args.includes("--agentic");
|
|
392
|
-
const isCorrelate = args.includes("--correlate");
|
|
393
|
-
const isSeo = args.includes("--seo");
|
|
394
|
-
const clusterLogs = !args.includes("--no-cluster-logs");
|
|
395
|
-
let nlpPrompt = null;
|
|
396
|
-
const promptIdx = args.indexOf("--prompt");
|
|
397
|
-
if (promptIdx !== -1) nlpPrompt = args[promptIdx + 1];
|
|
398
|
-
const nlpScenarioIdx = args.indexOf("--nlp-scenario");
|
|
399
|
-
if (nlpScenarioIdx !== -1) nlpPrompt = args[nlpScenarioIdx + 1];
|
|
400
|
-
let threads = 10;
|
|
401
|
-
let durationSec = 10;
|
|
402
|
-
let rampUpSec = 0;
|
|
403
|
-
let rampDownSec = 0;
|
|
404
|
-
let targetApdex = 0.85;
|
|
405
|
-
let targetErrorRate = 0.01;
|
|
406
|
-
let maxThreads = 300;
|
|
407
|
-
let maxAllowedLatencyMs = 800;
|
|
408
|
-
let outputHtml = "blaze-dashboard.html";
|
|
409
|
-
let baselinePath = null;
|
|
410
|
-
const threadsIdx = args.indexOf("--threads");
|
|
411
|
-
if (threadsIdx !== -1) threads = parseInt(args[threadsIdx + 1], 10);
|
|
412
|
-
const durationIdx = args.indexOf("--duration");
|
|
413
|
-
if (durationIdx !== -1) durationSec = parseInt(args[durationIdx + 1], 10);
|
|
414
|
-
const rampUpIdx = args.indexOf("--ramp-up");
|
|
415
|
-
if (rampUpIdx !== -1) rampUpSec = parseInt(args[rampUpIdx + 1], 10);
|
|
416
|
-
const rampDownIdx = args.indexOf("--ramp-down");
|
|
417
|
-
if (rampDownIdx !== -1) rampDownSec = parseInt(args[rampDownIdx + 1], 10);
|
|
418
|
-
const apdexIdx = args.indexOf("--target-apdex");
|
|
419
|
-
if (apdexIdx !== -1) targetApdex = parseFloat(args[apdexIdx + 1]);
|
|
420
|
-
const errorIdx = args.indexOf("--target-error");
|
|
421
|
-
if (errorIdx !== -1) targetErrorRate = parseFloat(args[errorIdx + 1]);
|
|
422
|
-
const maxThreadsIdx = args.indexOf("--max-threads");
|
|
423
|
-
if (maxThreadsIdx !== -1) maxThreads = parseInt(args[maxThreadsIdx + 1], 10);
|
|
424
|
-
const outputIdx = args.indexOf("--output");
|
|
425
|
-
if (outputIdx !== -1) outputHtml = args[outputIdx + 1];
|
|
426
|
-
const baselineIdx = args.indexOf("--baseline");
|
|
427
|
-
if (baselineIdx !== -1) baselinePath = args[baselineIdx + 1];
|
|
428
|
-
const positionalNums = args.slice(1).filter((arg) => !arg.startsWith("-")).map(Number).filter((n) => !isNaN(n));
|
|
429
|
-
if (positionalNums.length > 0 && threadsIdx === -1 && !isAgentic) threads = positionalNums[0];
|
|
430
|
-
if (positionalNums.length > 1 && durationIdx === -1 && !isAgentic) durationSec = positionalNums[1];
|
|
431
|
-
if (positionalNums.length > 2 && errorIdx === -1 && !isAgentic) targetErrorRate = positionalNums[2] / 100;
|
|
432
|
-
if (isAgentic) {
|
|
433
|
-
const agenticIdx = args.indexOf("--agentic");
|
|
434
|
-
const trailingArgs = args.slice(agenticIdx + 1).filter((arg) => !arg.startsWith("--"));
|
|
435
|
-
if (trailingArgs[0]) maxThreads = parseInt(trailingArgs[0], 10);
|
|
436
|
-
if (trailingArgs[1]) {
|
|
437
|
-
let rawLatency = parseFloat(trailingArgs[1]);
|
|
438
|
-
if (rawLatency < 50) {
|
|
439
|
-
maxAllowedLatencyMs = rawLatency * 1e3;
|
|
440
|
-
} else {
|
|
441
|
-
maxAllowedLatencyMs = rawLatency;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
if (trailingArgs[2]) targetErrorRate = parseFloat(trailingArgs[2]) / 100;
|
|
445
|
-
}
|
|
446
|
-
return {
|
|
447
|
-
targetScript,
|
|
448
|
-
isAgentic,
|
|
449
|
-
isCorrelate,
|
|
450
|
-
isSeo,
|
|
451
|
-
clusterLogs,
|
|
452
|
-
nlpPrompt,
|
|
453
|
-
threads,
|
|
454
|
-
durationSec,
|
|
455
|
-
rampUpSec,
|
|
456
|
-
rampDownSec,
|
|
457
|
-
targetApdex,
|
|
458
|
-
targetErrorRate,
|
|
459
|
-
maxThreads,
|
|
460
|
-
stepSize: 15,
|
|
461
|
-
maxAllowedLatencyMs,
|
|
462
|
-
outputHtml,
|
|
463
|
-
baselinePath
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
373
|
async function runBlazeCoreEngine(config) {
|
|
467
374
|
return new Promise((resolve2) => {
|
|
468
375
|
setTimeout(() => {
|
|
@@ -1544,4 +1451,42 @@ function printUsage() {
|
|
|
1544
1451
|
Options:
|
|
1545
1452
|
--threads <count> | --duration <seconds> | --baseline <json_file> | --output <html_file> | --prompt "<natural language description>" | --correlate`);
|
|
1546
1453
|
}
|
|
1454
|
+
async function main() {
|
|
1455
|
+
const argv = yargs(hideBin(process.argv)).scriptName("blaze-cli").usage("$0 [targetScript] [options]").positional("targetScript", {
|
|
1456
|
+
type: "string",
|
|
1457
|
+
default: ".",
|
|
1458
|
+
describe: "Target script file or directory"
|
|
1459
|
+
}).option("prompt", { type: "string", describe: "Natural language description of the test" }).option("nlp-scenario", { type: "string", describe: "NLP scenario description" }).option("threads", { type: "number", default: 10, describe: "Number of concurrent threads / VUs" }).option("duration", { type: "number", default: 10, describe: "Duration of test in seconds" }).option("ramp-up", { type: "number", default: 0, describe: "Ramp-up duration in seconds" }).option("ramp-down", { type: "number", default: 0, describe: "Ramp-down duration in seconds" }).option("agentic", { type: "boolean", default: false, describe: "Run intelligent autonomous load agent" }).option("correlate", { type: "boolean", default: false, describe: "Run correlated transaction pipeline" }).option("seo", { type: "boolean", default: false, describe: "Include SEO rank impact analysis" }).option("no-cluster-logs", { type: "boolean", default: false, describe: "Disable log clustering" }).option("target-apdex", { type: "number", default: 0.85, describe: "Target Apdex score threshold" }).option("target-error", { type: "number", default: 0.01, describe: "Target max error rate" }).option("max-threads", { type: "number", default: 300, describe: "Max threads for agentic scaling" }).option("max-allowed-latency", { type: "number", default: 800, describe: "Max allowed latency in ms" }).option("output", { type: "string", default: "blaze-dashboard.html", describe: "Output HTML report path" }).option("baseline", { type: "string", default: null, describe: "Baseline comparison telemetry JSON path" }).help().alias("help", "h").parseSync();
|
|
1460
|
+
const config = {
|
|
1461
|
+
targetScript: path.resolve(argv._[0] ? String(argv._[0]) : "."),
|
|
1462
|
+
isAgentic: argv.agentic,
|
|
1463
|
+
isCorrelate: argv.correlate,
|
|
1464
|
+
isSeo: argv.seo,
|
|
1465
|
+
clusterLogs: !argv.noClusterLogs,
|
|
1466
|
+
nlpPrompt: argv.prompt || argv.nlpScenario || null,
|
|
1467
|
+
threads: argv.threads,
|
|
1468
|
+
durationSec: argv.duration,
|
|
1469
|
+
rampUpSec: argv.rampUp,
|
|
1470
|
+
rampDownSec: argv.rampDown,
|
|
1471
|
+
targetApdex: argv.targetApdex,
|
|
1472
|
+
targetErrorRate: argv.targetError,
|
|
1473
|
+
maxThreads: argv.maxThreads,
|
|
1474
|
+
stepSize: 15,
|
|
1475
|
+
maxAllowedLatencyMs: argv.maxAllowedLatency,
|
|
1476
|
+
outputHtml: argv.output,
|
|
1477
|
+
baselinePath: argv.baseline
|
|
1478
|
+
};
|
|
1479
|
+
if (argv.help || process.argv.slice(2).length === 0) {
|
|
1480
|
+
printUsage();
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
if (config.isCorrelate || config.nlpPrompt) {
|
|
1484
|
+
await executeTestPipeline(config);
|
|
1485
|
+
}
|
|
1486
|
+
if (config.isAgentic) {
|
|
1487
|
+
await runIntelligentAgenticStressTest(config);
|
|
1488
|
+
} else {
|
|
1489
|
+
await runStandardStressTest(config);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1547
1492
|
main().catch(console.error);
|
|
Binary file
|