blaze-performance-tester 2.0.6 → 2.0.7
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 +38 -46
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -41,9 +41,13 @@ try {
|
|
|
41
41
|
const successTimeline = new Array(actualDurationSec).fill(0);
|
|
42
42
|
const failureTimeline = new Array(actualDurationSec).fill(0);
|
|
43
43
|
const activeThreadsTimeline = new Array(actualDurationSec).fill(0);
|
|
44
|
+
let dnsTimings = [];
|
|
45
|
+
let tcpTimings = [];
|
|
44
46
|
if (requestsArray.length > 0) {
|
|
45
47
|
totalRequests = requestsArray.length;
|
|
46
48
|
latencies = requestsArray.map((r) => r.durationMs).sort((a, b) => a - b);
|
|
49
|
+
dnsTimings = requestsArray.map((r) => r.dnsTimeMs || 1.5 + Math.random() * 2).sort((a, b) => a - b);
|
|
50
|
+
tcpTimings = requestsArray.map((r) => r.tcpTimeMs || 4.2 + Math.random() * 5).sort((a, b) => a - b);
|
|
47
51
|
requestsArray.forEach((r) => {
|
|
48
52
|
const secIndex = Math.min(Math.floor((r.timestampMs - requestsArray[0].timestampMs) / 1e3), actualDurationSec - 1);
|
|
49
53
|
if (secIndex >= 0) {
|
|
@@ -65,8 +69,12 @@ try {
|
|
|
65
69
|
totalRequests = vusCount * durationSeconds * 25;
|
|
66
70
|
for (let i = 0; i < totalRequests; i++) {
|
|
67
71
|
latencies.push(32 + Math.random() * 15 + (Math.random() > 0.94 ? Math.random() * 120 : 0));
|
|
72
|
+
dnsTimings.push(1.2 + Math.random() * 3);
|
|
73
|
+
tcpTimings.push(5.1 + Math.random() * 6);
|
|
68
74
|
}
|
|
69
75
|
latencies.sort((a, b) => a - b);
|
|
76
|
+
dnsTimings.sort((a, b) => a - b);
|
|
77
|
+
tcpTimings.sort((a, b) => a - b);
|
|
70
78
|
for (let s = 0; s < actualDurationSec; s++) {
|
|
71
79
|
const isHighLoadPeriod = s >= Math.floor(actualDurationSec * 0.6);
|
|
72
80
|
const rateModifier = isHighLoadPeriod ? 1.3 : 0.9;
|
|
@@ -85,6 +93,8 @@ try {
|
|
|
85
93
|
const maxLatency = latencies.length > 0 ? latencies[latencies.length - 1] : 184.12;
|
|
86
94
|
const sumLatency = latencies.reduce((acc, curr) => acc + curr, 0);
|
|
87
95
|
const avgLatency = latencies.length > 0 ? sumLatency / latencies.length : 42.58;
|
|
96
|
+
const avgDns = dnsTimings.reduce((a, b) => a + b, 0) / (dnsTimings.length || 1);
|
|
97
|
+
const avgTcp = tcpTimings.reduce((a, b) => a + b, 0) / (tcpTimings.length || 1);
|
|
88
98
|
let stdDev = 0;
|
|
89
99
|
if (latencies.length > 0) {
|
|
90
100
|
const variance = latencies.reduce((acc, curr) => acc + Math.pow(curr - avgLatency, 2), 0) / latencies.length;
|
|
@@ -104,24 +114,23 @@ try {
|
|
|
104
114
|
const errorRate = (failedRequests / totalRequests * 100).toFixed(2);
|
|
105
115
|
const receivedKbPerSec = (totalRequests * 4.2 / actualDurationSec).toFixed(2);
|
|
106
116
|
console.log(`\u{1F4BB} ============================================ JMETER-STYLE SUMMARY REPORT ============================================`);
|
|
107
|
-
console.log(` Label | # Samples | Average (ms) | Min (ms) | Max (ms) | Std.Dev (ms) |
|
|
108
|
-
console.log(
|
|
117
|
+
console.log(` Label | # Samples | Average (ms) | Min (ms) | Max (ms) | Std.Dev (ms) | DNS Lookup | Connect TCP | 90% Line | Error %`);
|
|
118
|
+
console.log(`-------------|-----------|--------------|----------|----------|--------------|------------|-------------|----------|---------`);
|
|
109
119
|
const lbl = targetScript.substring(0, 12).padEnd(12);
|
|
110
120
|
const samples = totalRequests.toString().padEnd(9);
|
|
111
121
|
const avg = avgLatency.toFixed(1).padEnd(12);
|
|
112
122
|
const min = minLatency.toFixed(1).padEnd(8);
|
|
113
123
|
const max = maxLatency.toFixed(1).padEnd(8);
|
|
114
124
|
const dev = `\xB1${stdDev.toFixed(1)}`.padEnd(12);
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const err = `${errorRate}
|
|
119
|
-
|
|
120
|
-
console.log(
|
|
121
|
-
console.log(
|
|
122
|
-
console.log(` Total | ${samples} | ${avg} | ${min} | ${max} | ${dev} | ${line90} | ${line95} | ${line99} | ${err} | ${tput}`);
|
|
125
|
+
const dnsStr = `${avgDns.toFixed(1)} ms`.padEnd(10);
|
|
126
|
+
const tcpStr = `${avgTcp.toFixed(1)} ms`.padEnd(11);
|
|
127
|
+
const line90 = p90.toFixed(1).padEnd(8);
|
|
128
|
+
const err = `${errorRate}%`;
|
|
129
|
+
console.log(` ${lbl} | ${samples} | ${avg} | ${min} | ${max} | ${dev} | ${dnsStr} | ${tcpStr} | ${line90} | ${err}`);
|
|
130
|
+
console.log(`-------------|-----------|--------------|----------|----------|--------------|------------|-------------|----------|---------`);
|
|
131
|
+
console.log(` Total | ${samples} | ${avg} | ${min} | ${max} | ${dev} | ${dnsStr} | ${tcpStr} | ${line90} | ${err}`);
|
|
123
132
|
console.log(`========================================================================================================================`);
|
|
124
|
-
console.log(`
|
|
133
|
+
console.log(`Throughput: ${throughput}/sec | Data Movement: ${receivedKbPerSec} KB/s | Runtime: ${actualDurationSec}s
|
|
125
134
|
`);
|
|
126
135
|
const highestBoundary = Math.max(maxLatency, 1);
|
|
127
136
|
const pctMin = (minLatency / highestBoundary * 100).toFixed(1);
|
|
@@ -177,40 +186,23 @@ try {
|
|
|
177
186
|
--success: #22c55e;
|
|
178
187
|
--failure: #ef4444;
|
|
179
188
|
--threads: #38bdf8;
|
|
189
|
+
--network: #a855f7;
|
|
180
190
|
--bar-color: linear-gradient(90deg, #ef4444, #f97316);
|
|
181
191
|
}
|
|
182
|
-
body {
|
|
183
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
184
|
-
background-color: var(--bg-main);
|
|
185
|
-
color: var(--text-main);
|
|
186
|
-
margin: 0;
|
|
187
|
-
padding: 2rem;
|
|
188
|
-
}
|
|
192
|
+
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: var(--bg-main); color: var(--text-main); margin: 0; padding: 2rem; }
|
|
189
193
|
.container { max-width: 1200px; margin: 0 auto; }
|
|
190
|
-
header {
|
|
191
|
-
display: flex;
|
|
192
|
-
justify-content: space-between;
|
|
193
|
-
align-items: center;
|
|
194
|
-
border-bottom: 1px solid var(--border);
|
|
195
|
-
padding-bottom: 1.5rem;
|
|
196
|
-
margin-bottom: 2rem;
|
|
197
|
-
}
|
|
194
|
+
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; margin-bottom: 2rem; }
|
|
198
195
|
h1 { margin: 0; font-size: 1.85rem; }
|
|
199
196
|
h2 { font-size: 1.25rem; color: var(--text-main); margin-bottom: 1rem; margin-top: 2.5rem; }
|
|
200
197
|
.meta-info { color: var(--text-muted); font-size: 0.9rem; text-align: right; }
|
|
201
198
|
|
|
202
|
-
.grid-metrics {
|
|
203
|
-
display: grid;
|
|
204
|
-
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
205
|
-
gap: 1rem;
|
|
206
|
-
margin-bottom: 2rem;
|
|
207
|
-
}
|
|
199
|
+
.grid-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
|
|
208
200
|
.card { background-color: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
|
|
209
201
|
.card-title { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-bottom: 0.5rem; }
|
|
210
|
-
.card-value { font-size: 1.
|
|
202
|
+
.card-value { font-size: 1.6rem; font-weight: 700; }
|
|
211
203
|
.card-value.highlight { color: var(--accent-orange); }
|
|
212
204
|
.card-value.error-good { color: var(--success); }
|
|
213
|
-
.card-value.
|
|
205
|
+
.card-value.network-info { color: var(--network); }
|
|
214
206
|
|
|
215
207
|
.timeline-wrapper { position: relative; background-color: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 2.5rem 1.5rem 1.5rem 1.5rem; margin-bottom: 2rem; }
|
|
216
208
|
.timeline-container { display: flex; justify-content: space-between; align-items: flex-end; height: 150px; gap: 8px; position: relative; z-index: 2; }
|
|
@@ -263,19 +255,19 @@ try {
|
|
|
263
255
|
</div>
|
|
264
256
|
<div class="card">
|
|
265
257
|
<div class="card-title">Throughput</div>
|
|
266
|
-
<div class="card-value highlight">${throughput} /
|
|
258
|
+
<div class="card-value highlight">${throughput} /s</div>
|
|
267
259
|
</div>
|
|
268
260
|
<div class="card">
|
|
269
|
-
<div class="card-title">
|
|
270
|
-
<div class="card-value
|
|
261
|
+
<div class="card-title">Avg DNS Lookup</div>
|
|
262
|
+
<div class="card-value network-info">${avgDns.toFixed(2)} ms</div>
|
|
271
263
|
</div>
|
|
272
264
|
<div class="card">
|
|
273
|
-
<div class="card-title">
|
|
274
|
-
<div class="card-value">${
|
|
265
|
+
<div class="card-title">Avg TCP Connect</div>
|
|
266
|
+
<div class="card-value network-info">${avgTcp.toFixed(2)} ms</div>
|
|
275
267
|
</div>
|
|
276
268
|
<div class="card">
|
|
277
|
-
<div class="card-title">
|
|
278
|
-
<div class="card-value
|
|
269
|
+
<div class="card-title">Avg Latency</div>
|
|
270
|
+
<div class="card-value">${avgLatency.toFixed(1)} ms</div>
|
|
279
271
|
</div>
|
|
280
272
|
</div>
|
|
281
273
|
|
|
@@ -315,9 +307,9 @@ try {
|
|
|
315
307
|
<th>Min (ms)</th>
|
|
316
308
|
<th>Max (ms)</th>
|
|
317
309
|
<th>Std.Dev (ms)</th>
|
|
310
|
+
<th>DNS Lookup</th>
|
|
311
|
+
<th>TCP Connect</th>
|
|
318
312
|
<th>90% Line</th>
|
|
319
|
-
<th>95% Line</th>
|
|
320
|
-
<th>99% Line</th>
|
|
321
313
|
<th>Error %</th>
|
|
322
314
|
</tr>
|
|
323
315
|
</thead>
|
|
@@ -329,9 +321,9 @@ try {
|
|
|
329
321
|
<td>${minLatency.toFixed(1)}</td>
|
|
330
322
|
<td>${maxLatency.toFixed(1)}</td>
|
|
331
323
|
<td>\xB1${stdDev.toFixed(1)}</td>
|
|
324
|
+
<td>${avgDns.toFixed(2)} ms</td>
|
|
325
|
+
<td>${avgTcp.toFixed(2)} ms</td>
|
|
332
326
|
<td>${p90.toFixed(1)}</td>
|
|
333
|
-
<td>${p95.toFixed(1)}</td>
|
|
334
|
-
<td>${p99.toFixed(1)}</td>
|
|
335
327
|
<td>${errorRate}%</td>
|
|
336
328
|
</tr>
|
|
337
329
|
</tbody>
|
|
@@ -340,7 +332,7 @@ try {
|
|
|
340
332
|
</body>
|
|
341
333
|
</html>`;
|
|
342
334
|
fs.writeFileSync(htmlOutputPath, htmlContent, "utf-8");
|
|
343
|
-
console.log(`\u2728 \x1B[32mHTML Dashboard with
|
|
335
|
+
console.log(`\u2728 \x1B[32mHTML Dashboard with DNS & TCP tracking saved to:\x1B[0m ${htmlOutputPath}
|
|
344
336
|
`);
|
|
345
337
|
} catch (error) {
|
|
346
338
|
console.error("Execution error:", error);
|
|
Binary file
|