blaze-performance-tester 1.1.5 → 1.1.6

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 +11 -11
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -31,26 +31,26 @@ console.log(`\x1B[33m\u{1F525} [Blaze] Injecting load tests using Blaze metrics
31
31
  `);
32
32
  try {
33
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);
34
+ const actualDurationSec = (metrics.execution_duration_ms || 0) / 1e3;
35
+ const throughput = (metrics.total_requests / (actualDurationSec || 1)).toFixed(2);
36
36
  const errorRate = (metrics.failed_requests / (metrics.total_requests || 1) * 100).toFixed(2);
37
37
  console.log(`\u{1F4CA} ==================== Blaze Performance Report ====================`);
38
38
  console.log(` Target Script: ${targetScript}`);
39
39
  console.log(` Active VUs: ${vusCount} parallel threads`);
40
40
  console.log(` Elapsed Time: ${actualDurationSec.toFixed(2)} seconds`);
41
41
  console.log(`-----------------------------------------------------------------------------`);
42
- console.log(` Samples (Requests): ${metrics.total_requests}`);
42
+ console.log(` Samples (Requests): ${metrics.total_requests ?? 0}`);
43
43
  console.log(` Throughput Rate: ${throughput} req/sec`);
44
- console.log(` Error Rate: ${errorRate}% (${metrics.failed_requests} failed)`);
44
+ console.log(` Error Rate: ${errorRate}% (${metrics.failed_requests ?? 0} failed)`);
45
45
  console.log(`-----------------------------------------------------------------------------`);
46
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`);
47
+ console.log(` \u251C\u2500\u2500 Minimum: ${(metrics.min_latency_ms ?? 0).toFixed(2)} ms`);
48
+ console.log(` \u251C\u2500\u2500 Average: ${(metrics.avg_latency_ms ?? 0).toFixed(2)} ms`);
49
+ console.log(` \u251C\u2500\u2500 Median (50%): ${(metrics.p50_latency_ms ?? 0).toFixed(2)} ms`);
50
+ console.log(` \u251C\u2500\u2500 90th %ile: ${(metrics.p90_latency_ms ?? 0).toFixed(2)} ms`);
51
+ console.log(` \u251C\u2500\u2500 95th %ile: ${(metrics.p95_latency_ms ?? 0).toFixed(2)} ms`);
52
+ console.log(` \u251C\u2500\u2500 99th %ile: ${(metrics.p99_latency_ms ?? 0).toFixed(2)} ms`);
53
+ console.log(` \u2514\u2500\u2500 Maximum: ${(metrics.max_latency_ms ?? 0).toFixed(2)} ms`);
54
54
  console.log(`=============================================================================`);
55
55
  } catch (error) {
56
56
  console.error("\x1B[31m\u{1F4A5} Critical Native Core Execution Error:\x1B[0m", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
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",