blaze-performance-tester 1.1.21 → 1.1.22
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 +155 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// cli.ts
|
|
2
|
+
import fs from "fs";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import { fileURLToPath } from "url";
|
|
4
5
|
import { createRequire } from "module";
|
|
@@ -25,6 +26,7 @@ var vusCount = parseInt(args[1], 10);
|
|
|
25
26
|
var durationSeconds = parseInt(args[2], 10);
|
|
26
27
|
var targetScriptPath = path.resolve(process.cwd(), targetScript);
|
|
27
28
|
var csvOutputPath = path.join(process.cwd(), "summary_report.csv");
|
|
29
|
+
var htmlOutputPath = path.join(process.cwd(), "blaze-html-report.html");
|
|
28
30
|
console.log(`
|
|
29
31
|
\u{1F525} [Blaze] Injecting load tests using Blaze metrics aggregation engine...
|
|
30
32
|
`);
|
|
@@ -82,6 +84,159 @@ try {
|
|
|
82
84
|
console.log(` Total | ${samples} | ${avg} | ${min} | ${max} | ${line90} | ${line95} | ${line99} | ${err} | ${tput} | ${kbs}`);
|
|
83
85
|
console.log(`================================================================================================================`);
|
|
84
86
|
console.log(`Test Execution Finished. Elapsed time: ${actualDurationSec.toFixed(2)}s | Target VUs: ${vusCount}
|
|
87
|
+
`);
|
|
88
|
+
const htmlContent = `<!DOCTYPE html>
|
|
89
|
+
<html lang="en">
|
|
90
|
+
<head>
|
|
91
|
+
<meta charset="UTF-8">
|
|
92
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
93
|
+
<title>Blaze Performance Report</title>
|
|
94
|
+
<style>
|
|
95
|
+
:root {
|
|
96
|
+
--bg-main: #0f172a;
|
|
97
|
+
--bg-card: #1e293b;
|
|
98
|
+
--accent-fire: #ef4444;
|
|
99
|
+
--accent-orange: #f97316;
|
|
100
|
+
--text-main: #f8fafc;
|
|
101
|
+
--text-muted: #94a3b8;
|
|
102
|
+
--border: #334155;
|
|
103
|
+
--success: #22c55e;
|
|
104
|
+
}
|
|
105
|
+
body {
|
|
106
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
107
|
+
background-color: var(--bg-main);
|
|
108
|
+
color: var(--text-main);
|
|
109
|
+
margin: 0;
|
|
110
|
+
padding: 2rem;
|
|
111
|
+
}
|
|
112
|
+
.container {
|
|
113
|
+
max-width: 1200px;
|
|
114
|
+
margin: 0 auto;
|
|
115
|
+
}
|
|
116
|
+
header {
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
align-items: center;
|
|
120
|
+
border-bottom: 1px solid var(--border);
|
|
121
|
+
padding-bottom: 1.5rem;
|
|
122
|
+
margin-bottom: 2rem;
|
|
123
|
+
}
|
|
124
|
+
h1 { margin: 0; font-size: 1.85rem; display: flex; align-items: center; gap: 0.5rem; }
|
|
125
|
+
.meta-info { color: var(--text-muted); font-size: 0.9rem; text-align: right; }
|
|
126
|
+
|
|
127
|
+
.grid-metrics {
|
|
128
|
+
display: grid;
|
|
129
|
+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
130
|
+
gap: 1rem;
|
|
131
|
+
margin-bottom: 2.5rem;
|
|
132
|
+
}
|
|
133
|
+
.card {
|
|
134
|
+
background-color: var(--bg-card);
|
|
135
|
+
border: 1px solid var(--border);
|
|
136
|
+
border-radius: 8px;
|
|
137
|
+
padding: 1.25rem;
|
|
138
|
+
}
|
|
139
|
+
.card-title { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
|
|
140
|
+
.card-value { font-size: 1.75rem; font-weight: 700; color: var(--text-main); }
|
|
141
|
+
.card-value.highlight { color: var(--accent-orange); }
|
|
142
|
+
.card-value.error-good { color: var(--success); }
|
|
143
|
+
|
|
144
|
+
table {
|
|
145
|
+
width: 100%;
|
|
146
|
+
border-collapse: collapse;
|
|
147
|
+
background-color: var(--bg-card);
|
|
148
|
+
border: 1px solid var(--border);
|
|
149
|
+
border-radius: 8px;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
margin-bottom: 2rem;
|
|
152
|
+
}
|
|
153
|
+
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
|
|
154
|
+
th { background-color: #111827; font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
|
|
155
|
+
tr:last-child td { border-bottom: none; }
|
|
156
|
+
.total-row { font-weight: 700; background-color: #1e293b; }
|
|
157
|
+
</style>
|
|
158
|
+
</head>
|
|
159
|
+
<body>
|
|
160
|
+
<div class="container">
|
|
161
|
+
<header>
|
|
162
|
+
<div>
|
|
163
|
+
<h1>\u{1F525} Blaze Performance Dashboard</h1>
|
|
164
|
+
<p style="margin: 0.25rem 0 0 0; color: var(--text-muted);">Target Execution Script: <strong>${targetScript}</strong></p>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="meta-info">
|
|
167
|
+
<div>Elapsed Duration: ${actualDurationSec.toFixed(2)}s</div>
|
|
168
|
+
<div>Concurrent VUs: ${vusCount} Parallel Threads</div>
|
|
169
|
+
</div>
|
|
170
|
+
</header>
|
|
171
|
+
|
|
172
|
+
<div class="grid-metrics">
|
|
173
|
+
<div class="card">
|
|
174
|
+
<div class="card-title">Total Samples</div>
|
|
175
|
+
<div class="card-value">${totalRequests}</div>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="card">
|
|
178
|
+
<div class="card-title">Throughput</div>
|
|
179
|
+
<div class="card-value highlight">${throughput} /sec</div>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="card">
|
|
182
|
+
<div class="card-title">Error Rate</div>
|
|
183
|
+
<div class="card-value ${parseFloat(errorRate) === 0 ? "error-good" : ""}">${errorRate}%</div>
|
|
184
|
+
</div>
|
|
185
|
+
<div class="card">
|
|
186
|
+
<div class="card-title">Average Latency</div>
|
|
187
|
+
<div class="card-value">${avgLatency.toFixed(1)} ms</div>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="card">
|
|
190
|
+
<div class="card-title">Bandwidth</div>
|
|
191
|
+
<div class="card-value" style="font-size: 1.4rem;">${receivedKbPerSec} KB/s</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<h2>Performance Breakdown Table</h2>
|
|
196
|
+
<table>
|
|
197
|
+
<thead>
|
|
198
|
+
<tr>
|
|
199
|
+
<th>Label</th>
|
|
200
|
+
<th># Samples</th>
|
|
201
|
+
<th>Average (ms)</th>
|
|
202
|
+
<th>Min (ms)</th>
|
|
203
|
+
<th>Max (ms)</th>
|
|
204
|
+
<th>90% Line</th>
|
|
205
|
+
<th>95% Line</th>
|
|
206
|
+
<th>99% Line</th>
|
|
207
|
+
<th>Error %</th>
|
|
208
|
+
</tr>
|
|
209
|
+
</thead>
|
|
210
|
+
<tbody>
|
|
211
|
+
<tr>
|
|
212
|
+
<td>${targetScript}</td>
|
|
213
|
+
<td>${totalRequests}</td>
|
|
214
|
+
<td>${avgLatency.toFixed(1)}</td>
|
|
215
|
+
<td>${minLatency.toFixed(1)}</td>
|
|
216
|
+
<td>${maxLatency.toFixed(1)}</td>
|
|
217
|
+
<td>${p90.toFixed(1)}</td>
|
|
218
|
+
<td>${p95.toFixed(1)}</td>
|
|
219
|
+
<td>${p99.toFixed(1)}</td>
|
|
220
|
+
<td>${errorRate}%</td>
|
|
221
|
+
</tr>
|
|
222
|
+
<tr class="total-row">
|
|
223
|
+
<td>Total</td>
|
|
224
|
+
<td>${totalRequests}</td>
|
|
225
|
+
<td>${avgLatency.toFixed(1)}</td>
|
|
226
|
+
<td>${minLatency.toFixed(1)}</td>
|
|
227
|
+
<td>${maxLatency.toFixed(1)}</td>
|
|
228
|
+
<td>${p90.toFixed(1)}</td>
|
|
229
|
+
<td>${p95.toFixed(1)}</td>
|
|
230
|
+
<td>${p99.toFixed(1)}</td>
|
|
231
|
+
<td>${errorRate}%</td>
|
|
232
|
+
</tr>
|
|
233
|
+
</tbody>
|
|
234
|
+
</table>
|
|
235
|
+
</div>
|
|
236
|
+
</body>
|
|
237
|
+
</html>`;
|
|
238
|
+
fs.writeFileSync(htmlOutputPath, htmlContent, "utf-8");
|
|
239
|
+
console.log(`\u2728 \x1B[32mHTML Dashboard successfully saved to:\x1B[0m ${htmlOutputPath}
|
|
85
240
|
`);
|
|
86
241
|
} catch (error) {
|
|
87
242
|
console.error("Execution error:", error);
|
|
Binary file
|