blaze-performance-tester 3.1.44 → 3.1.45
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 +24 -54
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -90,20 +90,15 @@ 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
|
|
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>`;
|
|
93
|
+
return `<span style="color: #ef4444;">\u26A0\uFE0F Gemini API Key missing. Export GEMINI_API_KEY to enable automated 2.5 Flash RCA analysis.</span>`;
|
|
97
94
|
}
|
|
98
|
-
console.log("\u{1F9E0}
|
|
95
|
+
console.log("\u{1F9E0} Querying Gemini 2.5 Flash for Advanced Root Cause Analysis...");
|
|
99
96
|
const formattedHistory = history.map(
|
|
100
97
|
(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)}`
|
|
101
98
|
).join("\n");
|
|
102
|
-
const uniqueLogs = Array.from(new Set(errorLogs)).slice(0,
|
|
99
|
+
const uniqueLogs = Array.from(new Set(errorLogs)).slice(0, 10).join("\n");
|
|
103
100
|
const prompt = `
|
|
104
|
-
You are
|
|
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.
|
|
101
|
+
You are an expert Performance & Systems Reliability Engineer. Analyze the following load test execution telemetry and logs to compose a full Root Cause Analysis (RCA) report featuring a Generative Incident Narrative timeline:
|
|
107
102
|
|
|
108
103
|
[LOAD SUMMARY METRICS]
|
|
109
104
|
- Unified Blaze Health Score: ${finalSummary.healthScore}/100
|
|
@@ -114,34 +109,18 @@ Your goal is to abstract the technical metrics and exceptions into an instantly
|
|
|
114
109
|
[EXECUTION STEP HISTORY]
|
|
115
110
|
${formattedHistory}
|
|
116
111
|
|
|
117
|
-
[
|
|
112
|
+
[UNIQUE LOG SAMPLES EXPLORATION]
|
|
118
113
|
${uniqueLogs || "No unique structural exceptions encountered."}
|
|
119
114
|
|
|
120
|
-
|
|
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.
|
|
115
|
+
Provide a comprehensive, highly technical Root Cause Analysis (RCA) report structured exactly as follows:
|
|
122
116
|
|
|
123
|
-
|
|
117
|
+
Paragraph 1 - GENERATIVE INCIDENT NARRATIVE: Write a clean, plain-English story of the incident that builds a chronological timeline of the failure event (e.g., "At 00:12s, traffic spiked by 40%. This caused database connection pool exhaustion, which triggered a cascading series of 504 errors on the checkout endpoint, ultimately hitting a knee-point crash at 500 virtual users."). Translate raw logs and metrics trends directly into an easy-to-read chronological story.
|
|
124
118
|
|
|
125
|
-
|
|
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>
|
|
119
|
+
Paragraph 2 - TECHNICAL BOTTLENECK DIAGNOSIS: Diagnose the exact bottleneck point (CPU saturation, socket pool exhaustion, database lock contention, etc.) indicated by how latency changes dynamically alongside concurrency, and correlate unique structural exception/error patterns directly to the performance drops.
|
|
131
120
|
|
|
132
|
-
|
|
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>
|
|
121
|
+
Paragraph 3 - ARCHITECTURAL SIZING RECOMMENDATIONS: Give concrete, infrastructure sizing or cloud architecture remediation recommendations based on the stress points found.
|
|
138
122
|
|
|
139
|
-
|
|
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>
|
|
123
|
+
CRITICAL: Return ONLY plain paragraph text. Do not use markdown headers (###). If you use bold text, use standard HTML <strong> tags. Wrap lines cleanly.
|
|
145
124
|
`;
|
|
146
125
|
try {
|
|
147
126
|
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, {
|
|
@@ -151,7 +130,7 @@ Use the exact layout blueprint below for your response text:
|
|
|
151
130
|
contents: [{ parts: [{ text: prompt }] }],
|
|
152
131
|
generationConfig: {
|
|
153
132
|
temperature: 0.2,
|
|
154
|
-
maxOutputTokens:
|
|
133
|
+
maxOutputTokens: 2048
|
|
155
134
|
}
|
|
156
135
|
})
|
|
157
136
|
});
|
|
@@ -163,22 +142,14 @@ Use the exact layout blueprint below for your response text:
|
|
|
163
142
|
if (candidate?.finishReason && candidate.finishReason !== "STOP") {
|
|
164
143
|
throw new Error(`Generation halted by Gemini API. Reason: ${candidate.finishReason}`);
|
|
165
144
|
}
|
|
166
|
-
|
|
145
|
+
const candidateText = candidate?.content?.parts?.[0]?.text;
|
|
167
146
|
if (!candidateText) {
|
|
168
147
|
throw new Error(`Malformed API layout or empty response body. Raw Payload: ${JSON.stringify(data)}`);
|
|
169
148
|
}
|
|
170
|
-
|
|
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>");
|
|
149
|
+
return candidateText.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\n/g, "<br>");
|
|
176
150
|
} catch (error) {
|
|
177
151
|
console.error("\u274C Gemini API processing breakdown failure:", error);
|
|
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>`;
|
|
152
|
+
return `<span style="color: #f87171;">Failed to generate AI diagnosis framework: ${error.message || error}</span>`;
|
|
182
153
|
}
|
|
183
154
|
}
|
|
184
155
|
async function executeTestPipeline(config) {
|
|
@@ -648,7 +619,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
648
619
|
logClustersHtml = `
|
|
649
620
|
<div class="card" style="margin-top: 2rem; background: #131c2e; border: 1px solid #1e293b;">
|
|
650
621
|
<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;">
|
|
651
|
-
\
|
|
622
|
+
\u{1F9E0} Semantic Log Clustering & Error Classification
|
|
652
623
|
</h3>
|
|
653
624
|
<div style="color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem;">
|
|
654
625
|
Captured <strong style="color: #f8fafc;">${totalLogCount}</strong> raw failures grouped into <strong style="color: #f8fafc;">${uniquePatternsCount}</strong> unique structural patterns.
|
|
@@ -879,16 +850,6 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
879
850
|
</div>
|
|
880
851
|
</div>
|
|
881
852
|
|
|
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
|
-
|
|
892
853
|
<div class="top-layout-grid">
|
|
893
854
|
<div class="verdict-box">
|
|
894
855
|
<div class="verdict-title">\u{1F916} AI Stress-Testing Agent Verdict</div>
|
|
@@ -947,6 +908,15 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
947
908
|
</div>
|
|
948
909
|
</div>
|
|
949
910
|
|
|
911
|
+
<div class="card" style="margin-bottom: 2rem; background: #0c172b; border: 1px solid #7c3aed;">
|
|
912
|
+
<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;">
|
|
913
|
+
\u26A1 Gemini 2.5 Flash Autonomous Root Cause Analysis (RCA)
|
|
914
|
+
</h3>
|
|
915
|
+
<div style="font-size: 0.95rem; line-height: 1.6; color: #cbd5e1; padding: 0.5rem 0; white-space: pre-wrap; word-break: break-word;">
|
|
916
|
+
${geminiAnalysisHtml}
|
|
917
|
+
</div>
|
|
918
|
+
</div>
|
|
919
|
+
|
|
950
920
|
<div class="charts-grid">
|
|
951
921
|
<div class="graph-card">
|
|
952
922
|
<div class="graph-title">\u{1F4CA} Throughput Velocity & Workload Volume</div>
|
|
Binary file
|