blaze-performance-tester 3.0.38 → 3.0.40
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 +57 -29
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
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}
|
|
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 and diagnostics confidence ratings.
|
|
491
491
|
</div>
|
|
492
492
|
|
|
493
|
-
<
|
|
494
|
-
|
|
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,53 @@ 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
|
+
const clarityBonus = c.severity === "CRITICAL" ? 15 : 8;
|
|
503
|
+
const freqScore = Math.min(25, c.count * 0.5);
|
|
504
|
+
const confidenceScore = Math.min(99, Math.round(65 + freqScore + clarityBonus));
|
|
505
|
+
let confColor = "#10b981";
|
|
506
|
+
if (confidenceScore < 80) confColor = "#f59e0b";
|
|
507
|
+
if (confidenceScore < 70) confColor = "#ef4444";
|
|
508
|
+
let fixTitle = "Infrastructure Pool & Tuning Fix";
|
|
509
|
+
let fixCode = "const pool = new Pool({ max: 50, idleTimeoutMillis: 30000 });";
|
|
510
|
+
let explanation = "High concurrency is causing socket/connection starvation. Increase connection limits or enable pooling keep-alives.";
|
|
511
|
+
if (c.category === "Authentication_Error") {
|
|
512
|
+
fixTitle = "Auth Token / JWT Strategy";
|
|
513
|
+
fixCode = "// Implement token caching and silent rotation\napp.use(authMiddleware({ cacheTtl: 300, allowGracePeriod: 60 }));";
|
|
514
|
+
explanation = "Frequent token verification failures under load. Extend signature verification cache or decouple auth validation check.";
|
|
515
|
+
} else if (c.category === "Product_Error") {
|
|
516
|
+
fixTitle = "Application Null-Safety / Guard Fix";
|
|
517
|
+
fixCode = "const configId = payload?.config_id ?? defaultConfigurationId;\nif (!configId) throw new ValidationError('Missing config_id');";
|
|
518
|
+
explanation = "Runtime reference error for undefined payload field under race condition spikes. Add optional chaining and input contracts.";
|
|
519
|
+
}
|
|
520
|
+
const snippetId = `snippet-${idx}`;
|
|
511
521
|
return `
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
<
|
|
515
|
-
|
|
516
|
-
<span style="
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
<details style="background: #090d16; border: 1px solid #1e293b; border-radius: 6px; overflow: hidden;">
|
|
523
|
+
<summary style="padding: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none;">
|
|
524
|
+
<div style="display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;">
|
|
525
|
+
<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>
|
|
526
|
+
<span style="color: ${catColor}; font-weight: 600; font-size: 0.95rem;">${c.category}</span>
|
|
527
|
+
<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>
|
|
528
|
+
<span style="background: rgba(16, 185, 129, 0.15); color: ${confColor}; border: 1px solid ${confColor}40; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: bold;">AI Confidence: ${confidenceScore}%</span>
|
|
529
|
+
</div>
|
|
530
|
+
<div style="color: #64748b; font-size: 0.85rem; font-family: monospace;">Expand Playbook \u25BC</div>
|
|
531
|
+
</summary>
|
|
532
|
+
<div style="padding: 1.25rem; border-top: 1px solid #1e293b; background: #0f172a;">
|
|
533
|
+
<div style="margin-bottom: 1rem;">
|
|
534
|
+
<div style="color: #64748b; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; margin-bottom: 0.25rem;">Detected Log Fingerprint</div>
|
|
535
|
+
<code style="color: #cbd5e1; font-family: monospace; font-size: 0.85rem; word-break: break-all;">${cleanedTemplate}</code>
|
|
536
|
+
</div>
|
|
537
|
+
<div style="margin-bottom: 1.25rem;">
|
|
538
|
+
<div style="color: #38bdf8; font-size: 0.9rem; font-weight: bold; margin-bottom: 0.25rem;">\u{1F4A1} Playbook Strategy: ${fixTitle}</div>
|
|
539
|
+
<div style="color: #94a3b8; font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.75rem;">${explanation}</div>
|
|
540
|
+
<div style="position: relative; background: #0b111e; border: 1px solid #1e293b; border-radius: 4px; padding: 0.75rem;">
|
|
541
|
+
<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>
|
|
542
|
+
<pre id="${snippetId}" style="margin: 0; color: #4ade80; font-family: monospace; font-size: 0.85rem; white-space: pre-wrap;">${fixCode}</pre>
|
|
524
543
|
</div>
|
|
525
|
-
</
|
|
526
|
-
</
|
|
544
|
+
</div>
|
|
545
|
+
</div>
|
|
546
|
+
</details>`;
|
|
527
547
|
}).join("")}
|
|
528
|
-
|
|
529
|
-
</table>
|
|
548
|
+
</div>
|
|
530
549
|
</div>`;
|
|
531
550
|
}
|
|
532
551
|
const liveAdjusterHtml = `
|
|
@@ -769,6 +788,15 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
769
788
|
</div>
|
|
770
789
|
|
|
771
790
|
<script>
|
|
791
|
+
function copyToClipboard(containerId) {
|
|
792
|
+
const text = document.getElementById(containerId).innerText;
|
|
793
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
794
|
+
alert('Copied remediation snippet to clipboard!');
|
|
795
|
+
}).catch(err => {
|
|
796
|
+
console.error('Failed to copy text: ', err);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
|
|
772
800
|
const labels = ${JSON.stringify(labels)};
|
|
773
801
|
const baseThroughput = ${cards.throughput};
|
|
774
802
|
const baseLatency = ${cards.ttfb};
|
|
Binary file
|