blaze-performance-tester 3.1.29 → 3.1.30
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 +22 -15
- package/dist/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -93,35 +93,42 @@ async function fetchRcaInsights(semanticReport, apiKey) {
|
|
|
93
93
|
}
|
|
94
94
|
const errorSummary = semanticReport.clusters.map((c) => `[Count: ${c.count}] Category: ${c.category} -> Pattern: ${c.template}`).join("\n");
|
|
95
95
|
try {
|
|
96
|
-
const response = await fetch(
|
|
96
|
+
const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${apiKey}`, {
|
|
97
97
|
method: "POST",
|
|
98
98
|
headers: {
|
|
99
|
-
"Content-Type": "application/json"
|
|
100
|
-
"Authorization": `Bearer ${apiKey}`
|
|
99
|
+
"Content-Type": "application/json"
|
|
101
100
|
},
|
|
102
101
|
body: JSON.stringify({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
systemInstruction: {
|
|
103
|
+
parts: [
|
|
104
|
+
{
|
|
105
|
+
text: "You are a principal systems architect and site reliability engineer. Return clean, direct HTML list items (using <li> tags, no raw markdown blocks) summarizing diagnostics."
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
contents: [
|
|
109
110
|
{
|
|
110
111
|
role: "user",
|
|
111
|
-
|
|
112
|
+
parts: [
|
|
113
|
+
{
|
|
114
|
+
text: `Analyze these performance test errors and provide 3 bullet points detailing the likely backend bottleneck (e.g., database connection pool exhaustion) and practical configuration fixes.
|
|
112
115
|
|
|
113
116
|
Error Log Patterns:
|
|
114
117
|
${errorSummary}`
|
|
118
|
+
}
|
|
119
|
+
]
|
|
115
120
|
}
|
|
116
121
|
],
|
|
117
|
-
|
|
122
|
+
generationConfig: {
|
|
123
|
+
temperature: 0.2
|
|
124
|
+
}
|
|
118
125
|
})
|
|
119
126
|
});
|
|
120
127
|
if (!response.ok) {
|
|
121
128
|
return `<span style="color: #ef4444;">AI Completion API Error: ${response.status} ${response.statusText}</span>`;
|
|
122
129
|
}
|
|
123
130
|
const data = await response.json();
|
|
124
|
-
return data.
|
|
131
|
+
return data.candidates?.[0]?.content?.parts?.[0]?.text || "<li>Failed to aggregate autonomous analysis parameters.</li>";
|
|
125
132
|
} catch (error) {
|
|
126
133
|
return `<span style="color: #ef4444;">Failed to resolve external cloud model: ${error.message}</span>`;
|
|
127
134
|
}
|
|
@@ -187,7 +194,7 @@ function parseArguments(args) {
|
|
|
187
194
|
let maxThreads = 300;
|
|
188
195
|
let maxAllowedLatencyMs = 800;
|
|
189
196
|
let outputHtml = "blaze-dashboard.html";
|
|
190
|
-
let aiKey = "";
|
|
197
|
+
let aiKey = process.env.GEMINI_API_KEY || "";
|
|
191
198
|
const threadsIdx = args.indexOf("--threads");
|
|
192
199
|
if (threadsIdx !== -1) threads = parseInt(args[threadsIdx + 1], 10);
|
|
193
200
|
const durationIdx = args.indexOf("--duration");
|
|
@@ -602,7 +609,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
602
609
|
if (config.clusterLogs) {
|
|
603
610
|
const content = rcaInsights ? rcaInsights : `
|
|
604
611
|
<div style="background: #090d16; padding: 1rem; border-radius: 6px; border: 1px dashed #475569; color: #94a3b8;">
|
|
605
|
-
\u{1F4A1} <strong>Autonomous RCA Available:</strong> Pass the <code>--ai-key <your-key></code> flag
|
|
612
|
+
\u{1F4A1} <strong>Autonomous RCA Available:</strong> Pass the <code>--ai-key <your-key></code> flag, or configure a <code>GEMINI_API_KEY</code> environment variable in your PowerShell runtime session to dynamically structure error logs here.
|
|
606
613
|
</div>`;
|
|
607
614
|
rcaAccordionHtml = `
|
|
608
615
|
<details class="card" style="margin-top: 2rem; background: #131c2e; border: 1px solid #8b5cf6; padding: 0; overflow: hidden;" open>
|
|
@@ -819,7 +826,7 @@ function exportHtmlDashboard(history, config, verdictReason, semanticReport, res
|
|
|
819
826
|
</style></head><body>
|
|
820
827
|
<div class="container">
|
|
821
828
|
<div class="header">
|
|
822
|
-
<h1>\u{1F525} Blaze Core Performance
|
|
829
|
+
<h1>\u{1F525} Blaze Core Performance Report</h1>
|
|
823
830
|
<div class="meta">Target Script: <code>${config.targetScript}</code></div>
|
|
824
831
|
</div>
|
|
825
832
|
|
|
Binary file
|