blaze-performance-tester 3.0.18 → 3.0.19

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 CHANGED
@@ -175,6 +175,10 @@ async function runIntelligentAgenticStressTest(config) {
175
175
  console.log(`\u{1F3AF} Target Constraints: Apdex >= ${config.targetApdex} | Error Rate <= ${(config.targetErrorRate * 100).toFixed(1)}% | SLA Target <= ${config.maxAllowedLatencyMs}ms`);
176
176
  const history = [];
177
177
  let aggregateErrorLogs = [];
178
+ let total2xx = 0;
179
+ let total3xx = 0;
180
+ let total4xx = 0;
181
+ let total5xx = 0;
178
182
  let currentThreads = Math.min(config.maxThreads, Math.max(5, Math.floor(config.maxThreads * 0.2)));
179
183
  let baseStep = config.stepSize;
180
184
  let isStable = true;
@@ -185,6 +189,10 @@ async function runIntelligentAgenticStressTest(config) {
185
189
  if (config.clusterLogs) {
186
190
  aggregateErrorLogs = aggregateErrorLogs.concat(rawErrors);
187
191
  }
192
+ total2xx += metrics.c2xx;
193
+ total3xx += metrics.c3xx;
194
+ total4xx += metrics.c4xx;
195
+ total5xx += metrics.c5xx;
188
196
  const currentState = {
189
197
  threads: currentThreads,
190
198
  avgLatency: metrics.avgLatencyMs,
@@ -245,7 +253,7 @@ async function runIntelligentAgenticStressTest(config) {
245
253
  console.log(`\u2705 Analysis Complete. Identified ${semanticReport.uniqueClustersCount} distinct signature blueprints.`);
246
254
  }
247
255
  generateFinalAgentReport(history);
248
- exportHtmlDashboard(history, config, verdictReason, semanticReport);
256
+ exportHtmlDashboard(history, config, verdictReason, semanticReport, { total2xx, total3xx, total4xx, total5xx });
249
257
  }
250
258
  async function runStandardStressTest(config) {
251
259
  console.log(`\u{1F3CB}\uFE0F Running Standard Stress Test [Threads: ${config.threads} | Duration: ${config.durationSec}s]`);
@@ -266,7 +274,12 @@ async function runStandardStressTest(config) {
266
274
  }
267
275
  const isPassed = metrics.apdexScore >= config.targetApdex && metrics.errorRate <= config.targetErrorRate;
268
276
  const verdictReason = isPassed ? "Static single-wave baseline checks concluded successfully without triggering health boundaries." : "Static verification loop completed with values exceeding defined quality thresholds.";
269
- exportHtmlDashboard(history, config, verdictReason, semanticReport);
277
+ exportHtmlDashboard(history, config, verdictReason, semanticReport, {
278
+ total2xx: metrics.c2xx,
279
+ total3xx: metrics.c3xx,
280
+ total4xx: metrics.c4xx,
281
+ total5xx: metrics.c5xx
282
+ });
270
283
  }
271
284
  function generateSimulationData(threads, durationSec, maxAllowedLatencyMs) {
272
285
  const data = [];
@@ -286,7 +299,7 @@ function generateSimulationData(threads, durationSec, maxAllowedLatencyMs) {
286
299
  let errorMessage;
287
300
  let statusCode = 200;
288
301
  if (isError) {
289
- statusCode = 500;
302
+ statusCode = Math.random() > 0.3 ? 500 : 404;
290
303
  errorMessage = `[${(/* @__PURE__ */ new Date()).toISOString()}] ` + errorPool[Math.floor(Math.random() * errorPool.length)];
291
304
  }
292
305
  data.push({
@@ -307,7 +320,14 @@ function processMetricsTelemetry(requests, durationSec) {
307
320
  const avgLatencyMs = mathUtils.mean(durations);
308
321
  const stdDevMs = mathUtils.stdDev(durations, avgLatencyMs);
309
322
  const p95LatencyMs = mathUtils.percentile(durations, 95);
310
- const errorCount = requests.filter((r) => r.statusCode >= 400).length;
323
+ let c2xx = 0, c3xx = 0, c4xx = 0, c5xx = 0;
324
+ requests.forEach((r) => {
325
+ if (r.statusCode >= 200 && r.statusCode < 300) c2xx++;
326
+ else if (r.statusCode >= 300 && r.statusCode < 400) c3xx++;
327
+ else if (r.statusCode >= 400 && r.statusCode < 500) c4xx++;
328
+ else if (r.statusCode >= 500) c5xx++;
329
+ });
330
+ const errorCount = c4xx + c5xx;
311
331
  const errorRate = totalRequests === 0 ? 0 : errorCount / totalRequests;
312
332
  const T = 100;
313
333
  const satisfied = requests.filter((r) => r.durationMs <= T && r.statusCode < 400).length;
@@ -320,7 +340,11 @@ function processMetricsTelemetry(requests, durationSec) {
320
340
  stdDevMs,
321
341
  p95LatencyMs,
322
342
  errorRate,
323
- apdexScore
343
+ apdexScore,
344
+ c2xx,
345
+ c3xx,
346
+ c4xx,
347
+ c5xx
324
348
  };
325
349
  }
326
350
  function printMatrixDashboard(m, threads) {
@@ -344,7 +368,7 @@ function generateFinalAgentReport(history) {
344
368
  console.log(`\u26A1 Peak Achieved Cluster Velocity : ${peakThroughput.toFixed(0)} req/sec`);
345
369
  console.log("=======================================================\n");
346
370
  }
347
- function exportHtmlDashboard(history, config, verdictReason, semanticReport) {
371
+ function exportHtmlDashboard(history, config, verdictReason, semanticReport, responseMatrix) {
348
372
  const labels = history.map((h) => `${h.threads} Threads`);
349
373
  const throughputData = history.map((h) => h.throughput.toFixed(0));
350
374
  const latencyData = history.map((h) => h.avgLatency.toFixed(1));
@@ -400,12 +424,13 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport) {
400
424
  .header { border-bottom: 1px solid #334155; padding-bottom: 1rem; margin-bottom: 1.5rem; }
401
425
  h1 { color: #38bdf8; margin: 0; font-size: 2rem; }
402
426
  .meta { color: #94a3b8; font-size: 0.9rem; margin-top: 0.5rem; }
427
+ .top-layout-grid { display: grid; grid-template-columns: 1fr 450px; gap: 2rem; margin-bottom: 2rem; }
403
428
  .verdict-box {
404
429
  background: #111827;
405
430
  border: 1px dashed #ea580c;
406
431
  border-radius: 8px;
407
432
  padding: 1.25rem;
408
- margin-bottom: 2rem;
433
+ height: fit-content;
409
434
  }
410
435
  .verdict-title {
411
436
  text-transform: uppercase;
@@ -434,6 +459,56 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport) {
434
459
  .wave-item {
435
460
  margin: 0.25rem 0;
436
461
  }
462
+
463
+ /* \u{1F4CB} HTTP RESPONSE MATRIX BOX */
464
+ .matrix-box {
465
+ background: #1e293b;
466
+ border: 1px solid #334155;
467
+ border-radius: 8px;
468
+ padding: 1.5rem;
469
+ }
470
+ .matrix-title {
471
+ font-size: 1.15rem;
472
+ font-weight: bold;
473
+ color: #ffffff;
474
+ margin-bottom: 1.25rem;
475
+ display: flex;
476
+ align-items: center;
477
+ gap: 0.5rem;
478
+ }
479
+ .matrix-row {
480
+ display: flex;
481
+ justify-content: space-between;
482
+ align-items: center;
483
+ padding: 0.75rem 0;
484
+ border-bottom: 1px solid #334155;
485
+ }
486
+ .matrix-row:last-child {
487
+ border-bottom: none;
488
+ }
489
+ .matrix-label {
490
+ font-size: 0.95rem;
491
+ color: #f8fafc;
492
+ display: flex;
493
+ align-items: center;
494
+ gap: 0.5rem;
495
+ }
496
+ .matrix-badge {
497
+ font-size: 0.75rem;
498
+ font-weight: bold;
499
+ padding: 0.15rem 0.4rem;
500
+ border-radius: 4px;
501
+ }
502
+ .badge-2xx { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
503
+ .badge-3xx { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
504
+ .badge-4xx { background: rgba(234, 179, 8, 0.2); color: #fde047; }
505
+ .badge-5xx { background: rgba(220, 38, 38, 0.2); color: #f87171; }
506
+ .matrix-value {
507
+ font-size: 1.1rem;
508
+ font-weight: bold;
509
+ color: #ffffff;
510
+ }
511
+
437
512
  .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
438
513
  .card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 1.5rem; }
439
514
  h3 { margin-top: 0; color: #cbd5e1; border-bottom: 1px solid #334155; padding-bottom: 0.5rem; }
@@ -450,20 +525,50 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport) {
450
525
  <h1>\u{1F525} Blaze Core Performance Analysis</h1>
451
526
  <div class="meta">Target Script: <code>${config.targetScript}</code> | Mode: ${config.isAgentic ? "\u{1F9E0} Intelligent Agentic" : "\u{1F3CB}\uFE0F Fixed Workload"}</div>
452
527
  </div>
453
- <div class="verdict-box">
454
- <div class="verdict-title">\u{1F916} AI Stress-Testing Agent Verdict</div>
455
- <div class="verdict-text">
456
- Blaze Agent auto-evaluated execution telemetry across <strong>${history.length} test waves</strong>.
457
- ${verdictReason}
528
+
529
+ <div class="top-layout-grid">
530
+ <div class="verdict-box">
531
+ <div class="verdict-title">\u{1F916} AI Stress-Testing Agent Verdict</div>
532
+ <div class="verdict-text">
533
+ Blaze Agent auto-evaluated execution telemetry across <strong>${history.length} test waves</strong>.
534
+ ${verdictReason}
535
+ </div>
536
+ <div class="verdict-waves">
537
+ ${waveListItems}
538
+ </div>
458
539
  </div>
459
- <div class="verdict-waves">
460
- ${waveListItems}
540
+
541
+ <!-- \u{1F4CB} DYNAMIC HTTP RESPONSE MATRIX COMPONENT -->
542
+ <div class="matrix-box">
543
+ <div class="matrix-title">\u{1F4CB} HTTP Response Matrix</div>
544
+
545
+ <div class="matrix-row">
546
+ <div class="matrix-label">Successful <span class="matrix-badge badge-2xx">2xx</span></div>
547
+ <div class="matrix-value">${responseMatrix.total2xx}</div>
548
+ </div>
549
+
550
+ <div class="matrix-row">
551
+ <div class="matrix-label">Redirects <span class="matrix-badge badge-3xx">3xx</span></div>
552
+ <div class="matrix-value">${responseMatrix.total3xx}</div>
553
+ </div>
554
+
555
+ <div class="matrix-row">
556
+ <div class="matrix-label">Client Error <span class="matrix-badge badge-4xx">4xx</span></div>
557
+ <div class="matrix-value">${responseMatrix.total4xx}</div>
558
+ </div>
559
+
560
+ <div class="matrix-row">
561
+ <div class="matrix-label">Server Error <span class="matrix-badge badge-5xx">5xx</span></div>
562
+ <div class="matrix-value">${responseMatrix.total5xx}</div>
563
+ </div>
461
564
  </div>
462
565
  </div>
566
+
463
567
  <div class="grid">
464
568
  <div class="card"><canvas id="throughputChart"></canvas></div>
465
569
  <div class="card"><canvas id="latencyChart"></canvas></div>
466
570
  </div>
571
+
467
572
  <div class="card">
468
573
  <h3>Telemetry Matrix Logs</h3>
469
574
  <table>
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.0.18",
3
+ "version": "3.0.19",
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",