blaze-performance-tester 3.1.31 → 3.1.32

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
@@ -133,41 +133,6 @@ ${errorSummary}`
133
133
  return `<span style="color: #ef4444;">Failed to resolve external cloud model: ${error.message}</span>`;
134
134
  }
135
135
  }
136
- async function fetchIncidentNarrative(history, semanticReport, apiKey) {
137
- const timelineSummary = history.map((h) => `Wave Tier [${h.threads} VUs] -> Throughput: ${h.throughput.toFixed(0)} req/s, Avg Latency: ${h.avgLatency.toFixed(1)}ms, Error Rate: ${(h.errorRate * 100).toFixed(2)}%`).join("\n");
138
- const logSummary = semanticReport && semanticReport.clusters ? semanticReport.clusters.map((c) => `[Error Count: ${c.count}] Pattern Blueprint: ${c.template}`).join("\n") : "No major software errors logged.";
139
- try {
140
- const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, {
141
- method: "POST",
142
- headers: { "Content-Type": "application/json" },
143
- body: JSON.stringify({
144
- systemInstruction: {
145
- parts: [{
146
- text: "You are an expert technical writer and lead SRE. Write a fluid, highly professional, plain-English narrative story explaining the timeline of how the system degraded during this load test. Synthesize the raw timeline curves and matching log errors together. Return clean, elegant paragraphs (<p> text </p>) using standard HTML inline formatting elements like <strong> where needed. Do not wrap the response in markdown block quotes (like ```html)."
147
- }]
148
- },
149
- contents: [{
150
- role: "user",
151
- parts: [{
152
- text: `Analyze this historical load pipeline timeline and corresponding logs. Write a clear narrative detailing the failure journey as concurrency grew:
153
-
154
- === Chronological Testing Waves ===
155
- ${timelineSummary}
156
-
157
- === Captured Structural Error Blueprints ===
158
- ${logSummary}`
159
- }]
160
- }],
161
- generationConfig: { temperature: 0.4 }
162
- })
163
- });
164
- if (!response.ok) return `<em>Narrative generator unavailable: ${response.statusText}</em>`;
165
- const data = await response.json();
166
- return data.candidates?.[0]?.content?.parts?.[0]?.text || "<em>Failed to construct incident storyline parameters.</em>";
167
- } catch (e) {
168
- return `<em>Failed to compile conversational telemetry narrative: ${e.message}</em>`;
169
- }
170
- }
171
136
  async function executeTestPipeline(config) {
172
137
  if (!blazeCore || typeof blazeCore.runCorrelatedTransaction !== "function") {
173
138
  console.error("\u274C Error: runCorrelatedTransaction function is missing from the compiled binary bindings.");
@@ -176,13 +141,13 @@ async function executeTestPipeline(config) {
176
141
  const transactionalScenario = [
177
142
  {
178
143
  name: "Fetch Target Anti-Forgery Nonce",
179
- url: "[https://httpbin.org/json](https://httpbin.org/json)",
144
+ url: "https://httpbin.org/json",
180
145
  method: "GET",
181
146
  body: null
182
147
  },
183
148
  {
184
149
  name: "Perform Contextual Post Action",
185
- url: "[https://httpbin.org/post?verification=](https://httpbin.org/post?verification=)${csrf_token}",
150
+ url: "https://httpbin.org/post?verification=${csrf_token}",
186
151
  method: "POST",
187
152
  body: JSON.stringify({
188
153
  data: "performance_payload",
@@ -413,7 +378,6 @@ async function runIntelligentAgenticStressTest(config) {
413
378
  }
414
379
  let semanticReport = null;
415
380
  let rcaInsights = "";
416
- let incidentNarrative = "";
417
381
  if (config.clusterLogs) {
418
382
  if (aggregateErrorLogs.length === 0) {
419
383
  aggregateErrorLogs = getFallbackClusterLogs();
@@ -423,8 +387,6 @@ async function runIntelligentAgenticStressTest(config) {
423
387
  if (config.aiKey) {
424
388
  console.log("\u{1F9E0} Fetching autonomous root-cause analysis from model...");
425
389
  rcaInsights = await fetchRcaInsights(semanticReport, config.aiKey);
426
- console.log("\u{1F4D6} Generating plain-English incident narrative...");
427
- incidentNarrative = await fetchIncidentNarrative(history, semanticReport, config.aiKey);
428
390
  }
429
391
  }
430
392
  const finalState = history[history.length - 1] || { apdex: 0, errorRate: 0, p95Latency: 0, throughput: 0 };
@@ -451,7 +413,7 @@ async function runIntelligentAgenticStressTest(config) {
451
413
  Object.keys(globalCodeCounts).forEach((code) => {
452
414
  breakdownRates[code] = totalRequestsAccumulator === 0 ? 0 : globalCodeCounts[code] / totalRequestsAccumulator * 100;
453
415
  });
454
- exportHtmlDashboard(history, config, verdictReason, semanticReport, { total1xx, total2xx, total3xx, total4xx, total5xx, breakdownRates }, finalSummaryCards, lastRawRequests, rcaInsights, incidentNarrative);
416
+ exportHtmlDashboard(history, config, verdictReason, semanticReport, { total1xx, total2xx, total3xx, total4xx, total5xx, breakdownRates }, finalSummaryCards, lastRawRequests, rcaInsights);
455
417
  }
456
418
  async function runStandardStressTest(config) {
457
419
  console.log(`\u{1F3CB}\uFE0F Running Standard Stress Test [Threads: ${config.threads} | Duration: ${config.durationSec}s]`);
@@ -471,7 +433,6 @@ async function runStandardStressTest(config) {
471
433
  }];
472
434
  let semanticReport = null;
473
435
  let rcaInsights = "";
474
- let incidentNarrative = "";
475
436
  if (config.clusterLogs) {
476
437
  let errsToProcess = rawErrors;
477
438
  if (errsToProcess.length === 0) errsToProcess = getFallbackClusterLogs();
@@ -480,8 +441,6 @@ async function runStandardStressTest(config) {
480
441
  if (config.aiKey) {
481
442
  console.log("\u{1F9E0} Fetching autonomous root-cause analysis from model...");
482
443
  rcaInsights = await fetchRcaInsights(semanticReport, config.aiKey);
483
- console.log("\u{1F4D6} Generating plain-English incident narrative...");
484
- incidentNarrative = await fetchIncidentNarrative(history, semanticReport, config.aiKey);
485
444
  }
486
445
  }
487
446
  const finalSummaryCards = {
@@ -513,7 +472,7 @@ async function runStandardStressTest(config) {
513
472
  total4xx: metrics.c4xx,
514
473
  total5xx: metrics.c5xx,
515
474
  breakdownRates
516
- }, finalSummaryCards, rawRequests, rcaInsights, incidentNarrative);
475
+ }, finalSummaryCards, rawRequests, rcaInsights);
517
476
  }
518
477
  function getFallbackClusterLogs() {
519
478
  const logs = [];
@@ -568,7 +527,7 @@ function processMetricsTelemetry(requests, durationSec) {
568
527
  const avgTlsMs = mathUtils.mean(requests.map((r) => r.tlsTimeMs || 0));
569
528
  const avgTtfbMs = avgDnsMs + avgTcpMs + avgTlsMs + avgLatencyMs * 0.3;
570
529
  let c1xx = 0, c2xx = 0, c3xx = 0, c4xx = 0, c5xx = 0;
571
- const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 502, 503: 0, 504: 0 };
530
+ const codeCounts = { 400: 0, 401: 0, 403: 0, 404: 0, 429: 0, 500: 0, 502: 0, 503: 0, 504: 0 };
572
531
  requests.forEach((r) => {
573
532
  if (r.statusCode >= 100 && r.statusCode < 200) c1xx++;
574
533
  else if (r.statusCode >= 200 && r.statusCode < 300) c2xx++;
@@ -629,7 +588,7 @@ function generateFinalAgentReport(history, score) {
629
588
  console.log(`\u26A1 Peak Achieved Cluster Velocity : ${peakThroughput.toFixed(0)} req/sec`);
630
589
  console.log("=======================================================\n");
631
590
  }
632
- function exportHtmlDashboard(history, config, verdictReason, semanticReport, responseMatrix, cards, rawRequests = [], rcaInsights = "", incidentNarrative = "") {
591
+ function exportHtmlDashboard(history, config, verdictReason, semanticReport, responseMatrix, cards, rawRequests = [], rcaInsights = "") {
633
592
  const labels = history.map((h, i) => `${i + 1}s`);
634
593
  const successRequestsData = history.map((h) => h.successRequests);
635
594
  const failedWorkloadsData = history.map((h) => h.failedRequests);
@@ -809,7 +768,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
809
768
  const htmlContent = `<!DOCTYPE html><html lang="en"><head>
810
769
  <meta charset="UTF-8">
811
770
  <title>Blaze Core Performance Report</title>
812
- <script src="[https://cdn.jsdelivr.net/npm/chart.js](https://cdn.jsdelivr.net/npm/chart.js)"></script>
771
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
813
772
  <style>
814
773
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0b111e; color: #f8fafc; margin: 0; padding: 2rem; }
815
774
  .container { max-width: 1300px; margin: 0 auto; }
@@ -910,14 +869,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
910
869
  <div class="verdict-box">
911
870
  <div class="verdict-title">\u{1F916} AI Stress-Testing Agent Verdict</div>
912
871
  <div class="verdict-text">${verdictReason}</div>
913
-
914
- <!-- GENERATIVE INCIDENT NARRATIVE INJECTION PANEL -->
915
- ${incidentNarrative ? `
916
- <div style="margin-top: 1rem; margin-bottom: 1rem; padding: 1rem; background: rgba(56, 189, 248, 0.06); border-left: 4px solid #38bdf8; border-radius: 4px; font-size: 0.95rem; line-height: 1.6; color: #cbd5e1;">
917
- <strong style="color: #38bdf8; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em;">\u{1F4D6} Generative Incident Narrative:</strong>
918
- ${incidentNarrative}
919
- </div>` : ""}
920
-
921
872
  <div class="verdict-waves">${waveListItems}</div>
922
873
  </div>
923
874
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.1.31",
3
+ "version": "3.1.32",
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",