blaze-performance-tester 3.1.34 → 3.1.35

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
@@ -334,7 +334,7 @@ async function runIntelligentAgenticStressTest(config) {
334
334
  const analyzer = new LogAnalyzer();
335
335
  semanticReport = analyzer.process(aggregateErrorLogs);
336
336
  }
337
- const finalState = history[history.length - 1] || { apdex: 0, errorRate: 0, p95Latency: 0, throughput: 0 };
337
+ const finalState = history[history.length - 1] || { apdex: 0, errorRate: 0, p95Latency: 0, throughput: 0, avgLatency: 0 };
338
338
  const healthScore = computeHealthScoreValue(finalState.apdex, finalState.errorRate, finalState.p95Latency, config.maxAllowedLatencyMs);
339
339
  const finalSummaryCards = {
340
340
  apdex: finalState.apdex,
@@ -355,7 +355,8 @@ async function runIntelligentAgenticStressTest(config) {
355
355
  console.log(`\u{1F50E} [SEO Impact Report]: Target latency under stress (${finalLat.toFixed(1)}ms) triggers a predicted Search Visibility Loss of -${seo.trafficLoss}% [Status: ${seo.status}].`);
356
356
  }
357
357
  const breakdownRates = {};
358
- Object.keys(globalCodeCounts).forEach((code) => {
358
+ Object.keys(globalCodeCounts).forEach((codeStr) => {
359
+ const code = parseInt(codeStr, 10);
359
360
  breakdownRates[code] = totalRequestsAccumulator === 0 ? 0 : globalCodeCounts[code] / totalRequestsAccumulator * 100;
360
361
  });
361
362
  exportHtmlDashboard(history, config, verdictReason, semanticReport, { total1xx, total2xx, total3xx, total4xx, total5xx, breakdownRates }, finalSummaryCards, lastRawRequests);
@@ -402,7 +403,8 @@ async function runStandardStressTest(config) {
402
403
  console.log(`\u{1F50E} [SEO Impact Report]: Target latency (${metrics.avgLatencyMs.toFixed(1)}ms) triggers a predicted Search Visibility Loss of -${seo.trafficLoss}% [Status: ${seo.status}].`);
403
404
  }
404
405
  const breakdownRates = {};
405
- Object.keys(metrics.codeCounts).forEach((code) => {
406
+ Object.keys(metrics.codeCounts).forEach((codeStr) => {
407
+ const code = parseInt(codeStr, 10);
406
408
  breakdownRates[code] = metrics.totalRequests === 0 ? 0 : metrics.codeCounts[code] / metrics.totalRequests * 100;
407
409
  });
408
410
  exportHtmlDashboard(history, config, verdictReason, semanticReport, {
@@ -467,7 +469,7 @@ function processMetricsTelemetry(requests, durationSec) {
467
469
  const avgTlsMs = mathUtils.mean(requests.map((r) => r.tlsTimeMs || 0));
468
470
  const avgTtfbMs = avgDnsMs + avgTcpMs + avgTlsMs + avgLatencyMs * 0.3;
469
471
  let c1xx = 0, c2xx = 0, c3xx = 0, c4xx = 0, c5xx = 0;
470
- const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 502, 503: 0, 504: 0 };
472
+ const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 0, 502: 0, 503: 0, 504: 0 };
471
473
  requests.forEach((r) => {
472
474
  if (r.statusCode >= 100 && r.statusCode < 200) c1xx++;
473
475
  else if (r.statusCode >= 200 && r.statusCode < 300) c2xx++;
@@ -545,33 +547,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
545
547
  x: Number(((r.timestampMs - firstTimestamp) / 1e3).toFixed(2)),
546
548
  y: Number(((r.dnsTimeMs || 0) + (r.tcpTimeMs || 0) + (r.tlsTimeMs || 0) + r.durationMs * 0.3).toFixed(1))
547
549
  }));
548
- let narrativeStoryText = "";
549
- const terminalWave = history[history.length - 1];
550
- const isSystemDegraded = cards.healthScore < 85 || terminalWave && terminalWave.errorRate > 0.01;
551
- if (isSystemDegraded) {
552
- let analyticalLogContext = "";
553
- if (semanticReport && semanticReport.clusters && semanticReport.clusters.length > 0) {
554
- const primaryPattern = semanticReport.clusters[0];
555
- const blueprintSample = (primaryPattern.template || "").replace(/\[\d{4}-\d{2}-\d{2}.*?\]\s*/, "").substring(0, 130);
556
- analyticalLogContext = ` The system failure state was dominated by a flood of <strong>${primaryPattern.category || "unclassified exceptions"}</strong> (${primaryPattern.count} trace entries), capturing dynamic footprints like: <code>${blueprintSample}...</code>.`;
557
- }
558
- narrativeStoryText = `<strong>Incident Narrative:</strong> During the load stress verification timeline, system resource contention triggered sharp degradation as simulated concurrency mounted up to <strong>${terminalWave?.threads || cards.saturationKneePoint} Virtual Users</strong>. At peak saturation, infrastructure throughput flattened out at <strong>${cards.throughput.toFixed(0)} req/sec</strong> while tracking metrics registered a P95 latency surge up to <strong>${terminalWave?.p95Latency.toFixed(1)}ms</strong>. ${verdictReason}${analyticalLogContext} The performance collapse dragged the composite health rating down to <strong>${cards.healthScore}/100</strong>, indicating target capacity boundaries have officially broken down under the active profile constraints.`;
559
- } else {
560
- narrativeStoryText = `<strong>Operational Summary:</strong> The pipeline concluded successfully without showing structural strain or performance compromises. Across the concurrency tiers peaking at <strong>${terminalWave?.threads || config.threads} active execution threads</strong>, infrastructure velocity sustained a robust <strong>${cards.throughput.toFixed(0)} req/sec</strong> with an exceptional Apdex tier of <strong>${cards.apdex.toFixed(2)}</strong>. Scanned event frameworks and metric trends yielded zero repeating error footprints, confirming system resilience matches the expected parameters perfectly with a health score of <strong>${cards.healthScore}/100</strong>.`;
561
- }
562
- const incidentNarrativeBoxHtml = `
563
- <div class="card" style="margin-bottom: 2rem; background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%); border: 1px solid #4338ca; border-radius: 8px; padding: 1.5rem; box-shadow: 0 4px 25px rgba(0, 0, 0, 0.55);">
564
- <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem;">
565
- <div style="display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: #818cf8; font-size: 1.1rem; text-transform: none; letter-spacing: normal;">
566
- \u{1F9E0} Generative Incident Narrative (AI Plain-English Summary)
567
- </div>
568
- <span style="background: #4338ca; color: #e0e7ff; font-size: 0.7rem; font-weight: 800; padding: 0.25rem 0.6rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em;">Telemetry Insight</span>
569
- </div>
570
- <p style="margin: 0; color: #cbd5e1; font-size: 0.95rem; line-height: 1.65; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
571
- ${narrativeStoryText}
572
- </p>
573
- </div>
574
- `;
575
550
  let logClustersHtml = "";
576
551
  if (semanticReport) {
577
552
  const totalLogCount = semanticReport.clusters.reduce((sum, c) => sum + c.count, 0);
@@ -770,7 +745,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
770
745
  .badge-fail { background: #dc2626; color: #fef2f2; }
771
746
  </style></head><body>
772
747
  <div class="container">
773
- ${incidentNarrativeBoxHtml}
774
748
  <div class="header">
775
749
  <h1>\u{1F525} Blaze Core Performance Analysis</h1>
776
750
  <div class="meta">Target Script: <code>${config.targetScript}</code></div>
@@ -1073,8 +1047,8 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
1073
1047
  },
1074
1048
  scales: {
1075
1049
  x: { grid: { color: '#1e293b' }, ticks: { color: '#64748b' } },
1076
- y_threads: { position: 'left', grid: { color: '#1e293b' }, ticks: { color: '#38bdf8' }, title: { display: true, text: 'VUs / Threads', color: '#38bdf8' } },
1077
- y_ttf: { position: 'right', grid: { drawOnChartArea: false }, ticks: { color: '#f43f5e' }, title: { display: true, text: 'TTF Index / Latency ms', color: '#f43f5e' } }
1050
+ yThreads: { position: 'left', grid: { color: '#1e293b' }, ticks: { color: '#38bdf8' }, title: { display: true, text: 'VUs / Threads', color: '#38bdf8' } },
1051
+ yTtf: { position: 'right', grid: { drawOnChartArea: false }, ticks: { color: '#f43f5e' }, title: { display: true, text: 'TTF Index / Latency ms', color: '#f43f5e' } }
1078
1052
  }
1079
1053
  }
1080
1054
  });
@@ -1094,7 +1068,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
1094
1068
  responsive: true,
1095
1069
  maintainAspectRatio: false,
1096
1070
  plugins: {
1097
- legend: { position: 'top', labels: { color: '#94a3b8', font: { size: 11 } },
1071
+ legend: { position: 'top', labels: { color: '#94a3b8', font: { size: 11 } } },
1098
1072
  cutout: '65%'
1099
1073
  }
1100
1074
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.1.34",
3
+ "version": "3.1.35",
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",