blaze-performance-tester 3.0.38 → 3.0.39

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
@@ -484,23 +484,14 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
484
484
  logClustersHtml = `
485
485
  <div class="card" style="margin-top: 2rem; background: #131c2e; border: 1px solid #1e293b;">
486
486
  <h3 style="border-bottom: none; padding-bottom: 0rem; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; color: #ffffff; font-size: 1.2rem;">
487
- \u{1F9E0} Semantic Log Clustering & Error Classification
487
+ \u{1F9E0} Interactive Remediation Playbooks & Log Classification
488
488
  </h3>
489
489
  <div style="color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem;">
490
- Captured <strong style="color: #f8fafc;">${totalLogCount}</strong> raw failures grouped into <strong style="color: #f8fafc;">${uniquePatternsCount}</strong> unique structural patterns.
490
+ Captured <strong style="color: #f8fafc;">${totalLogCount}</strong> raw failures grouped into <strong style="color: #f8fafc;">${uniquePatternsCount}</strong> unique structural patterns. Expand a playbook to inspect automated remediation strategies.
491
491
  </div>
492
492
 
493
- <table style="width: 100%; border-collapse: collapse;">
494
- <thead>
495
- <tr style="border-bottom: 1px solid #1e293b;">
496
- <th style="width: 8%; padding: 0.75rem; text-align: left; color: #64748b; font-size: 0.85rem; font-weight: bold; text-transform: none;">Count</th>
497
- <th style="width: 22%; padding: 0.75rem; text-align: left; color: #64748b; font-size: 0.85rem; font-weight: bold; text-transform: none;">Classification Category</th>
498
- <th style="width: 10%; padding: 0.75rem; text-align: left; color: #64748b; font-size: 0.85rem; font-weight: bold; text-transform: none;">Severity</th>
499
- <th style="width: 60%; padding: 0.75rem; text-align: left; color: #64748b; font-size: 0.85rem; font-weight: bold; text-transform: none;">Structural Abstract Blueprint / Dynamic Log Fingerprint</th>
500
- </tr>
501
- </thead>
502
- <tbody>
503
- ${semanticReport.clusters.map((c) => {
493
+ <div style="display: flex; flex-direction: column; gap: 1rem;">
494
+ ${semanticReport.clusters.map((c, idx) => {
504
495
  let catColor = "#fb923c";
505
496
  if (c.category === "Authentication_Error") catColor = "#c084fc";
506
497
  if (c.category === "Product_Error") catColor = "#f87171";
@@ -508,25 +499,46 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
508
499
  let sevBg = c.severity === "CRITICAL" ? "#dc2626" : "#ea580c";
509
500
  const rawTemplate = c.template || "";
510
501
  const cleanedTemplate = rawTemplate.replace(/\[\d{4}-\d{2}-\d{2}.*?\]\s*/, "");
502
+ let fixTitle = "Infrastructure Pool & Tuning Fix";
503
+ let fixCode = "const pool = new Pool({ max: 50, idleTimeoutMillis: 30000 });";
504
+ let explanation = "High concurrency is causing socket/connection starvation. Increase connection limits or enable pooling keep-alives.";
505
+ if (c.category === "Authentication_Error") {
506
+ fixTitle = "Auth Token / JWT Strategy";
507
+ fixCode = "// Implement token caching and silent rotation\napp.use(authMiddleware({ cacheTtl: 300, allowGracePeriod: 60 }));";
508
+ explanation = "Frequent token verification failures under load. Extend signature verification cache or decouple auth validation check.";
509
+ } else if (c.category === "Product_Error") {
510
+ fixTitle = "Application Null-Safety / Guard Fix";
511
+ fixCode = "const configId = payload?.config_id ?? defaultConfigurationId;\nif (!configId) throw new ValidationError('Missing config_id');";
512
+ explanation = "Runtime reference error for undefined payload field under race condition spikes. Add optional chaining and input contracts.";
513
+ }
514
+ const snippetId = `snippet-${idx}`;
511
515
  return `
512
- <tr style="border-bottom: 1px solid #1e293b; vertical-align: top;">
513
- <td style="padding: 1.25rem 0.75rem; font-size: 1.2rem; font-weight: bold; color: #f8fafc;">${c.count}</td>
514
- <td style="padding: 1.25rem 0.75rem; color: ${catColor}; font-weight: 600; font-size: 0.95rem;">${c.category}</td>
515
- <td style="padding: 1.25rem 0.75rem;">
516
- <span style="background: ${sevBg}; color: #ffffff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: bold; letter-spacing: 0.05em;">${c.severity}</span>
517
- </td>
518
- <td style="padding: 1.25rem 0.75rem;">
519
- <div style="background: #090d16; border-radius: 4px; padding: 0.6rem 0.8rem; border-left: 3px solid #1e293b; margin-bottom: 0.5rem;">
520
- <code style="color: #cbd5e1; font-family: monospace; font-size: 0.9rem; white-space: pre-wrap; word-break: break-all;">${cleanedTemplate}</code>
521
- </div>
522
- <div style="color: #64748b; font-size: 0.8rem; font-family: monospace; padding-left: 0.2rem; line-height: 1.4;">
523
- <span style="color: #475569;">Real Example Trace:</span> ${rawTemplate}
516
+ <details style="background: #090d16; border: 1px solid #1e293b; border-radius: 6px; overflow: hidden;">
517
+ <summary style="padding: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none;">
518
+ <div style="display: flex; align-items: center; gap: 1rem;">
519
+ <span style="font-size: 1.1rem; font-weight: bold; color: #f8fafc; background: #131c2e; padding: 0.2rem 0.6rem; border-radius: 4px;">${c.count}x</span>
520
+ <span style="color: ${catColor}; font-weight: 600; font-size: 0.95rem;">${c.category}</span>
521
+ <span style="background: ${sevBg}; color: #ffffff; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.65rem; font-weight: bold; letter-spacing: 0.05em;">${c.severity}</span>
522
+ </div>
523
+ <div style="color: #64748b; font-size: 0.85rem; font-family: monospace;">Expand Playbook \u25BC</div>
524
+ </summary>
525
+ <div style="padding: 1.25rem; border-top: 1px solid #1e293b; background: #0f172a;">
526
+ <div style="margin-bottom: 1rem;">
527
+ <div style="color: #64748b; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; margin-bottom: 0.25rem;">Detected Log Fingerprint</div>
528
+ <code style="color: #cbd5e1; font-family: monospace; font-size: 0.85rem; word-break: break-all;">${cleanedTemplate}</code>
529
+ </div>
530
+ <div style="margin-bottom: 1.25rem;">
531
+ <div style="color: #38bdf8; font-size: 0.9rem; font-weight: bold; margin-bottom: 0.25rem;">\u{1F4A1} Playbook Strategy: ${fixTitle}</div>
532
+ <div style="color: #94a3b8; font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.75rem;">${explanation}</div>
533
+ <div style="position: relative; background: #0b111e; border: 1px solid #1e293b; border-radius: 4px; padding: 0.75rem;">
534
+ <button onclick="copyToClipboard('${snippetId}')" style="position: absolute; top: 0.5rem; right: 0.5rem; background: #1e293b; color: #38bdf8; border: none; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.7rem; cursor: pointer;">Copy Fix</button>
535
+ <pre id="${snippetId}" style="margin: 0; color: #4ade80; font-family: monospace; font-size: 0.85rem; white-space: pre-wrap;">${fixCode}</pre>
524
536
  </div>
525
- </td>
526
- </tr>`;
537
+ </div>
538
+ </div>
539
+ </details>`;
527
540
  }).join("")}
528
- </tbody>
529
- </table>
541
+ </div>
530
542
  </div>`;
531
543
  }
532
544
  const liveAdjusterHtml = `
@@ -769,6 +781,15 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
769
781
  </div>
770
782
 
771
783
  <script>
784
+ function copyToClipboard(containerId) {
785
+ const text = document.getElementById(containerId).innerText;
786
+ navigator.clipboard.writeText(text).then(() => {
787
+ alert('Copied remediation snippet to clipboard!');
788
+ }).catch(err => {
789
+ console.error('Failed to copy text: ', err);
790
+ });
791
+ }
792
+
772
793
  const labels = ${JSON.stringify(labels)};
773
794
  const baseThroughput = ${cards.throughput};
774
795
  const baseLatency = ${cards.ttfb};
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "3.0.38",
3
+ "version": "3.0.39",
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",