blaze-performance-tester 1.1.3 → 1.1.5

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.
Files changed (2) hide show
  1. package/dist/cli.js +25 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -22,16 +22,36 @@ if (!fs.existsSync(targetScriptPath)) {
22
22
  console.error(`\x1B[31m\u274C Target workload script not found at:\x1B[0m ${targetScriptPath}`);
23
23
  process.exit(1);
24
24
  }
25
- var currentWorkingDirectory = process.cwd();
26
- var resultsFolder = path.join(currentWorkingDirectory, "results");
25
+ var resultsFolder = path.join(process.cwd(), "results");
27
26
  if (!fs.existsSync(resultsFolder)) {
28
27
  fs.mkdirSync(resultsFolder, { recursive: true });
29
28
  }
30
29
  var csvOutputPath = path.join(resultsFolder, "summary_report.csv");
31
- console.log(`\x1B[35m\u{1F525} Blaze Performance Tester Initialized... \x1B[0m`);
32
- console.log(`\u26A1 Spawning \x1B[32m${vusCount}\x1B[0m Virtual Users for \x1B[32m${durationSeconds}s\x1B[0m against scenario script.`);
30
+ console.log(`\x1B[33m\u{1F525} [Blaze] Injecting load tests using Blaze metrics aggregation engine...\x1B[0m
31
+ `);
33
32
  try {
34
- nativeBinding.runBlazeCore(targetScriptPath, vusCount, durationSeconds, csvOutputPath);
33
+ const metrics = nativeBinding.runBlazeCore(targetScriptPath, vusCount, durationSeconds, csvOutputPath);
34
+ const actualDurationSec = metrics.execution_duration_ms / 1e3;
35
+ const throughput = (metrics.total_requests / actualDurationSec).toFixed(2);
36
+ const errorRate = (metrics.failed_requests / (metrics.total_requests || 1) * 100).toFixed(2);
37
+ console.log(`\u{1F4CA} ==================== Blaze Performance Report ====================`);
38
+ console.log(` Target Script: ${targetScript}`);
39
+ console.log(` Active VUs: ${vusCount} parallel threads`);
40
+ console.log(` Elapsed Time: ${actualDurationSec.toFixed(2)} seconds`);
41
+ console.log(`-----------------------------------------------------------------------------`);
42
+ console.log(` Samples (Requests): ${metrics.total_requests}`);
43
+ console.log(` Throughput Rate: ${throughput} req/sec`);
44
+ console.log(` Error Rate: ${errorRate}% (${metrics.failed_requests} failed)`);
45
+ console.log(`-----------------------------------------------------------------------------`);
46
+ console.log(`\u{1F4C8} Latency Statistics (ms):`);
47
+ console.log(` \u251C\u2500\u2500 Minimum: ${metrics.min_latency_ms.toFixed(2)} ms`);
48
+ console.log(` \u251C\u2500\u2500 Average: ${metrics.avg_latency_ms.toFixed(2)} ms`);
49
+ console.log(` \u251C\u2500\u2500 Median (50%): ${metrics.p50_latency_ms.toFixed(2)} ms`);
50
+ console.log(` \u251C\u2500\u2500 90th %ile: ${metrics.p90_latency_ms.toFixed(2)} ms`);
51
+ console.log(` \u251C\u2500\u2500 95th %ile: ${metrics.p95_latency_ms.toFixed(2)} ms`);
52
+ console.log(` \u251C\u2500\u2500 99th %ile: ${metrics.p99_latency_ms.toFixed(2)} ms`);
53
+ console.log(` \u2514\u2500\u2500 Maximum: ${metrics.max_latency_ms.toFixed(2)} ms`);
54
+ console.log(`=============================================================================`);
35
55
  } catch (error) {
36
56
  console.error("\x1B[31m\u{1F4A5} Critical Native Core Execution Error:\x1B[0m", error);
37
57
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "A high-performance, multi-threaded load testing engine built with Rust and QuickJS.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",