blaze-performance-tester 3.1.42 → 3.1.44
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 +64 -25
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -90,15 +90,20 @@ var mathUtils = {
|
|
|
90
90
|
async function generateGeminiRCA(history, finalSummary, errorLogs) {
|
|
91
91
|
const apiKey = process.env.GEMINI_API_KEY;
|
|
92
92
|
if (!apiKey) {
|
|
93
|
-
return
|
|
93
|
+
return `
|
|
94
|
+
<div style="background: rgba(239, 68, 68, 0.1); border-left: 4px solid #ef4444; padding: 1rem; color: #f87171; border-radius: 4px;">
|
|
95
|
+
<strong>\u26A0\uFE0F Generative Incident Engine Inactive:</strong> Export your <code>GEMINI_API_KEY</code> environment variable to automatically translate raw error signatures and system thresholds into live operational story narratives.
|
|
96
|
+
</div>`;
|
|
94
97
|
}
|
|
95
|
-
console.log("\u{1F9E0}
|
|
98
|
+
console.log("\u{1F9E0} Synthesizing Generative Incident Narrative with Gemini 2.5 Flash...");
|
|
96
99
|
const formattedHistory = history.map(
|
|
97
100
|
(h) => `Threads: ${h.threads} VUs | Throughput: ${h.throughput.toFixed(1)} req/s | Avg Latency: ${h.avgLatency.toFixed(1)}ms | Errors: ${(h.errorRate * 100).toFixed(2)}% | Apdex: ${h.apdex.toFixed(2)}`
|
|
98
101
|
).join("\n");
|
|
99
|
-
const uniqueLogs = Array.from(new Set(errorLogs)).slice(0,
|
|
102
|
+
const uniqueLogs = Array.from(new Set(errorLogs)).slice(0, 15).join("\n");
|
|
100
103
|
const prompt = `
|
|
101
|
-
You are
|
|
104
|
+
You are a Principal Systems Reliability Engineer responding to a high-stress production system breakdown.
|
|
105
|
+
Operators are overwhelmed and do not have time to read through dense, raw stack traces or split-second log streams.
|
|
106
|
+
Your goal is to abstract the technical metrics and exceptions into an instantly clear executive report.
|
|
102
107
|
|
|
103
108
|
[LOAD SUMMARY METRICS]
|
|
104
109
|
- Unified Blaze Health Score: ${finalSummary.healthScore}/100
|
|
@@ -109,18 +114,34 @@ You are an expert Performance & Systems Reliability Engineer. Analyze the follow
|
|
|
109
114
|
[EXECUTION STEP HISTORY]
|
|
110
115
|
${formattedHistory}
|
|
111
116
|
|
|
112
|
-
[
|
|
117
|
+
[RAW EXCEPTION LOG INFRASTRUCTURE SAMPLES]
|
|
113
118
|
${uniqueLogs || "No unique structural exceptions encountered."}
|
|
114
119
|
|
|
115
|
-
|
|
120
|
+
CRITICAL STRUCTURAL OUTPUT INSTRUCTIONS:
|
|
121
|
+
You must return valid HTML components wrapped perfectly in the matching classes described below. Do not use Markdown notation like ### or \`\`\` blocks. Translate timelines dynamically based on the step history data.
|
|
116
122
|
|
|
117
|
-
|
|
123
|
+
Use the exact layout blueprint below for your response text:
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
<div class="narrative-block" style="background: #0f172a; border-left: 4px solid #38bdf8; padding: 1.25rem; border-radius: 4px; margin-bottom: 1.5rem;">
|
|
126
|
+
<h4 style="margin: 0 0 0.75rem 0; color: #38bdf8; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem;">\u{1F4D6} Generative Incident Narrative & Timeline</h4>
|
|
127
|
+
<p style="margin: 0; color: #cbd5e1; line-height: 1.6; font-size: 0.95rem;">
|
|
128
|
+
[Write a clean, plain-English chronological narrative story of the failure cycle. Explain how scaling up threads directly triggered performance degradation, referencing specific milestones, capacity points, and how the underlying logs trace back to this event. Make it read like a timeline story so operators know exactly what broke first without searching raw logs.]
|
|
129
|
+
</p>
|
|
130
|
+
</div>
|
|
120
131
|
|
|
121
|
-
|
|
132
|
+
<div class="diagnosis-block" style="background: #0f172a; border-left: 4px solid #a855f7; padding: 1.25rem; border-radius: 4px; margin-bottom: 1.5rem;">
|
|
133
|
+
<h4 style="margin: 0 0 0.75rem 0; color: #a855f7; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem;">\u{1F6E0}\uFE0F Technical Bottleneck Diagnosis</h4>
|
|
134
|
+
<p style="margin: 0; color: #cbd5e1; line-height: 1.6; font-size: 0.95rem;">
|
|
135
|
+
[Provide a technical deep-dive analyzing database pool state, lock contention, network barriers, or syntax breakdowns correlated against latency trends.]
|
|
136
|
+
</p>
|
|
137
|
+
</div>
|
|
122
138
|
|
|
123
|
-
|
|
139
|
+
<div class="remediation-block" style="background: #0f172a; border-left: 4px solid #10b981; padding: 1.25rem; border-radius: 4px;">
|
|
140
|
+
<h4 style="margin: 0 0 0.75rem 0; color: #10b981; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem;">\u2601\uFE0F Architectural Sizing Remediation</h4>
|
|
141
|
+
<p style="margin: 0; color: #cbd5e1; line-height: 1.6; font-size: 0.95rem;">
|
|
142
|
+
[List direct cloud engineering solutions, auto-scaling policy tweaks, config micro-adjustments, or infrastructure scale upgrades to eliminate the issue.]
|
|
143
|
+
</p>
|
|
144
|
+
</div>
|
|
124
145
|
`;
|
|
125
146
|
try {
|
|
126
147
|
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, {
|
|
@@ -130,17 +151,34 @@ CRITICAL: Return ONLY plain paragraph text. Do not use markdown headers (###). I
|
|
|
130
151
|
contents: [{ parts: [{ text: prompt }] }],
|
|
131
152
|
generationConfig: {
|
|
132
153
|
temperature: 0.2,
|
|
133
|
-
maxOutputTokens:
|
|
154
|
+
maxOutputTokens: 2500
|
|
134
155
|
}
|
|
135
156
|
})
|
|
136
157
|
});
|
|
137
158
|
const data = await response.json();
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
159
|
+
if (data?.error) {
|
|
160
|
+
throw new Error(`Google API Error ${data.error.code}: ${data.error.message}`);
|
|
161
|
+
}
|
|
162
|
+
const candidate = data?.candidates?.[0];
|
|
163
|
+
if (candidate?.finishReason && candidate.finishReason !== "STOP") {
|
|
164
|
+
throw new Error(`Generation halted by Gemini API. Reason: ${candidate.finishReason}`);
|
|
165
|
+
}
|
|
166
|
+
let candidateText = candidate?.content?.parts?.[0]?.text;
|
|
167
|
+
if (!candidateText) {
|
|
168
|
+
throw new Error(`Malformed API layout or empty response body. Raw Payload: ${JSON.stringify(data)}`);
|
|
169
|
+
}
|
|
170
|
+
if (candidateText.startsWith("```html")) {
|
|
171
|
+
candidateText = candidateText.replace(/^```html\s*/i, "").replace(/\s*```$/, "");
|
|
172
|
+
} else if (candidateText.startsWith("```")) {
|
|
173
|
+
candidateText = candidateText.replace(/^```\s*/, "").replace(/\s*```$/, "");
|
|
174
|
+
}
|
|
175
|
+
return candidateText.replace(/\*\*(.*?)\*\?/g, "<strong>$1</strong>");
|
|
141
176
|
} catch (error) {
|
|
142
177
|
console.error("\u274C Gemini API processing breakdown failure:", error);
|
|
143
|
-
return
|
|
178
|
+
return `
|
|
179
|
+
<div style="background: rgba(220, 38, 38, 0.1); border: 1px dashed #dc2626; padding: 1rem; border-radius: 6px; color: #f87171;">
|
|
180
|
+
<strong>\u26A0\uFE0F Narrative Pipeline Failure:</strong> Unable to assemble automated generative telemetry report text structure. [Reason: ${error.message || error}]
|
|
181
|
+
</div>`;
|
|
144
182
|
}
|
|
145
183
|
}
|
|
146
184
|
async function executeTestPipeline(config) {
|
|
@@ -610,7 +648,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
610
648
|
logClustersHtml = `
|
|
611
649
|
<div class="card" style="margin-top: 2rem; background: #131c2e; border: 1px solid #1e293b;">
|
|
612
650
|
<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;">
|
|
613
|
-
\
|
|
651
|
+
\u2699\uFE0F Underlying Structural Exceptions (Clustered Archive)
|
|
614
652
|
</h3>
|
|
615
653
|
<div style="color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem;">
|
|
616
654
|
Captured <strong style="color: #f8fafc;">${totalLogCount}</strong> raw failures grouped into <strong style="color: #f8fafc;">${uniquePatternsCount}</strong> unique structural patterns.
|
|
@@ -841,6 +879,16 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
841
879
|
</div>
|
|
842
880
|
</div>
|
|
843
881
|
|
|
882
|
+
<!-- MAIN AI DIAGNOSTIC REPORT HUB CONTAINER -->
|
|
883
|
+
<div class="card" style="margin-bottom: 2rem; background: #0c1220; border: 2px solid #7c3aed; box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.3);">
|
|
884
|
+
<h3 style="color: #c084fc; display: flex; align-items: center; gap: 0.6rem; font-size: 1.3rem; border-bottom: 1px solid #1e293b; padding-bottom: 0.75rem; margin-bottom: 1.25rem;">
|
|
885
|
+
\u26A1 Live AI Generative Incident Report & Breakdown Timeline
|
|
886
|
+
</h3>
|
|
887
|
+
<div style="font-size: 0.95rem; color: #cbd5e1;">
|
|
888
|
+
${geminiAnalysisHtml}
|
|
889
|
+
</div>
|
|
890
|
+
</div>
|
|
891
|
+
|
|
844
892
|
<div class="top-layout-grid">
|
|
845
893
|
<div class="verdict-box">
|
|
846
894
|
<div class="verdict-title">\u{1F916} AI Stress-Testing Agent Verdict</div>
|
|
@@ -899,15 +947,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
899
947
|
</div>
|
|
900
948
|
</div>
|
|
901
949
|
|
|
902
|
-
<div class="card" style="margin-bottom: 2rem; background: #0c172b; border: 1px solid #7c3aed;">
|
|
903
|
-
<h3 style="color: #a78bfa; display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; border-bottom: 1px solid #1e293b; padding-bottom: 0.5rem;">
|
|
904
|
-
\u26A1 Gemini 2.5 Flash Autonomous Root Cause Analysis (RCA)
|
|
905
|
-
</h3>
|
|
906
|
-
<div style="font-size: 0.95rem; line-height: 1.6; color: #cbd5e1; padding: 0.5rem 0; white-space: pre-wrap; word-break: break-word;">
|
|
907
|
-
${geminiAnalysisHtml}
|
|
908
|
-
</div>
|
|
909
|
-
</div>
|
|
910
|
-
|
|
911
950
|
<div class="charts-grid">
|
|
912
951
|
<div class="graph-card">
|
|
913
952
|
<div class="graph-title">\u{1F4CA} Throughput Velocity & Workload Volume</div>
|
|
Binary file
|