blaze-performance-tester 3.1.27 → 3.1.28

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
@@ -467,7 +467,7 @@ function processMetricsTelemetry(requests, durationSec) {
467
467
  const avgTlsMs = mathUtils.mean(requests.map((r) => r.tlsTimeMs || 0));
468
468
  const avgTtfbMs = avgDnsMs + avgTcpMs + avgTlsMs + avgLatencyMs * 0.3;
469
469
  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, 502: 0, 503: 0, 504: 0 };
470
+ const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 0, 502: 0, 503: 0, 504: 0 };
471
471
  requests.forEach((r) => {
472
472
  if (r.statusCode >= 100 && r.statusCode < 200) c1xx++;
473
473
  else if (r.statusCode >= 200 && r.statusCode < 300) c2xx++;
@@ -790,7 +790,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
790
790
  <div class="verdict-waves">${waveListItems}</div>
791
791
  </div>
792
792
 
793
- <!-- IMPLEMENTED CARD FEATURE 76: Executive Health Gauges Panel -->
794
793
  <div class="gauge-container-box">
795
794
  <div class="gauge-title">Blaze Run Health Score</div>
796
795
  <div style="position: relative; width: 140px; height: 140px; display: flex; align-items: center; justify-content: center;">
@@ -851,7 +850,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
851
850
  </div>
852
851
 
853
852
  <div class="graph-card">
854
- <div class="graph-title">\u{1F504} Active Concurrency (VUs) vs. TTF Trend</div>
853
+ <div class="graph-title">\u{1F504} Active Concurrency (VUs) vs. TTF Trend & AI Load Forecast</div>
855
854
  <div style="height: 280px; position: relative;">
856
855
  <canvas id="concurrencyChart"></canvas>
857
856
  </div>
@@ -960,14 +959,54 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
960
959
  }
961
960
  });
962
961
 
962
+ // --- AI FORECASTING LINE REGRESSION SETUP ---
963
+ const baseActiveThreads = ${JSON.stringify(activeThreadsData)};
964
+ const baseTtfTrend = ${JSON.stringify(ttfTrendData)};
965
+ const historicalCount = baseTtfTrend.length;
966
+
967
+ let extendedLabels = [...labels];
968
+ let extendedThreads = [...baseActiveThreads];
969
+ let extendedTtf = [...baseTtfTrend];
970
+ let aiForecastData = [];
971
+
972
+ if (historicalCount >= 2) {
973
+ let sumX = 0, sumY = 0, sumXY = 0, sumXX = 0;
974
+ for (let i = 0; i < historicalCount; i++) {
975
+ sumX += i;
976
+ sumY += baseTtfTrend[i];
977
+ sumXY += i * baseTtfTrend[i];
978
+ sumXX += i * i;
979
+ }
980
+ const denominator = (historicalCount * sumXX - sumX * sumX);
981
+ const slope = denominator === 0 ? 0 : (historicalCount * sumXY - sumX * sumY) / denominator;
982
+ const intercept = (sumY - slope * sumX) / historicalCount;
983
+
984
+ for (let i = 0; i < historicalCount; i++) {
985
+ aiForecastData.push(Number((slope * i + intercept).toFixed(1)));
986
+ }
987
+
988
+ const lastThreads = baseActiveThreads[historicalCount - 1] || 10;
989
+ const threadStep = ${config.stepSize || 15};
990
+
991
+ // Project out the next 3 hypothetical execution tiers
992
+ for (let i = 1; i <= 3; i++) {
993
+ extendedLabels.push(\`+\${i * 5}s (AI Forecast)\`);
994
+ extendedThreads.push(lastThreads + (threadStep * i));
995
+ extendedTtf.push(null);
996
+ aiForecastData.push(Number((slope * (historicalCount + i - 1) + intercept).toFixed(1)));
997
+ }
998
+ } else {
999
+ aiForecastData = [...baseTtfTrend];
1000
+ }
1001
+
963
1002
  new Chart(document.getElementById('concurrencyChart'), {
964
1003
  type: 'line',
965
1004
  data: {
966
- labels: labels,
1005
+ labels: extendedLabels,
967
1006
  datasets: [
968
1007
  {
969
1008
  label: 'Active VU Threads',
970
- data: ${JSON.stringify(activeThreadsData)},
1009
+ data: extendedThreads,
971
1010
  borderColor: '#38bdf8',
972
1011
  backgroundColor: 'rgba(56, 189, 248, 0.1)',
973
1012
  borderWidth: 2.5,
@@ -977,13 +1016,24 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
977
1016
  },
978
1017
  {
979
1018
  label: 'Time-to-Failure (TTF) Trend',
980
- data: ${JSON.stringify(ttfTrendData)},
1019
+ data: extendedTtf,
981
1020
  borderColor: '#f43f5e',
982
1021
  borderWidth: 2,
983
1022
  borderDash: [5, 5],
984
1023
  pointRadius: 3,
985
1024
  fill: false,
986
1025
  yAxisID: 'yTtf'
1026
+ },
1027
+ {
1028
+ label: '\u{1F52E} AI Capacity Forecast Line',
1029
+ data: aiForecastData,
1030
+ borderColor: '#a855f7',
1031
+ borderWidth: 2,
1032
+ borderDash: [3, 3],
1033
+ pointRadius: 4,
1034
+ pointBackgroundColor: '#a855f7',
1035
+ fill: false,
1036
+ yAxisID: 'yTtf'
987
1037
  }
988
1038
  ]
989
1039
  },
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.1.27",
3
+ "version": "3.1.28",
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",