blaze-performance-tester 2.0.1 → 2.0.3

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 CHANGED
@@ -85,22 +85,29 @@ try {
85
85
  console.log(`================================================================================================================`);
86
86
  console.log(`Test Execution Finished. Elapsed time: ${actualDurationSec.toFixed(2)}s | Target VUs: ${vusCount}
87
87
  `);
88
+ const highestBoundary = Math.max(maxLatency, 1);
89
+ const pctMin = (minLatency / highestBoundary * 100).toFixed(1);
90
+ const pctAvg = (avgLatency / highestBoundary * 100).toFixed(1);
91
+ const pct90 = (p90 / highestBoundary * 100).toFixed(1);
92
+ const pct95 = (p95 / highestBoundary * 100).toFixed(1);
93
+ const pct99 = (p99 / highestBoundary * 100).toFixed(1);
94
+ const pctMax = 100;
88
95
  const htmlContent = `<!DOCTYPE html>
89
96
  <html lang="en">
90
97
  <head>
91
98
  <meta charset="UTF-8">
92
99
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
93
- <title>Blaze Performance Report</title>
100
+ <title>Blaze Performance Dashboard</title>
94
101
  <style>
95
102
  :root {
96
103
  --bg-main: #0f172a;
97
104
  --bg-card: #1e293b;
98
- --accent-fire: #ef4444;
99
105
  --accent-orange: #f97316;
100
106
  --text-main: #f8fafc;
101
107
  --text-muted: #94a3b8;
102
108
  --border: #334155;
103
109
  --success: #22c55e;
110
+ --bar-color: linear-gradient(90deg, #ef4444, #f97316);
104
111
  }
105
112
  body {
106
113
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
@@ -109,10 +116,7 @@ try {
109
116
  margin: 0;
110
117
  padding: 2rem;
111
118
  }
112
- .container {
113
- max-width: 1200px;
114
- margin: 0 auto;
115
- }
119
+ .container { max-width: 1200px; margin: 0 auto; }
116
120
  header {
117
121
  display: flex;
118
122
  justify-content: space-between;
@@ -121,26 +125,40 @@ try {
121
125
  padding-bottom: 1.5rem;
122
126
  margin-bottom: 2rem;
123
127
  }
124
- h1 { margin: 0; font-size: 1.85rem; display: flex; align-items: center; gap: 0.5rem; }
128
+ h1 { margin: 0; font-size: 1.85rem; }
129
+ h2 { font-size: 1.25rem; color: var(--text-main); margin-bottom: 1rem; margin-top: 2rem; }
125
130
  .meta-info { color: var(--text-muted); font-size: 0.9rem; text-align: right; }
126
131
 
127
132
  .grid-metrics {
128
133
  display: grid;
129
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
134
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
130
135
  gap: 1rem;
131
- margin-bottom: 2.5rem;
136
+ margin-bottom: 2rem;
132
137
  }
133
- .card {
138
+ .card { background-color: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
139
+ .card-title { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-bottom: 0.5rem; }
140
+ .card-value { font-size: 1.75rem; font-weight: 700; }
141
+ .card-value.highlight { color: var(--accent-orange); }
142
+ .card-value.error-good { color: var(--success); }
143
+
144
+ /* OFFLINE SECURE VISUAL BAR CHART CONTAINER */
145
+ .chart-section {
134
146
  background-color: var(--bg-card);
135
147
  border: 1px solid var(--border);
136
148
  border-radius: 8px;
137
- padding: 1.25rem;
149
+ padding: 1.5rem;
150
+ margin-bottom: 2rem;
138
151
  }
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
-
152
+ .chart-row {
153
+ display: flex;
154
+ align-items: center;
155
+ margin-bottom: 0.85rem;
156
+ }
157
+ .chart-label { width: 100px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
158
+ .chart-bar-wrapper { flex-grow: 1; background-color: #111827; border-radius: 4px; height: 24px; margin: 0 1rem; overflow: hidden; position: relative; }
159
+ .chart-bar { height: 100%; background: var(--bar-color); border-radius: 4px; transition: width 0.5s ease-in-out; }
160
+ .chart-value-tag { width: 80px; font-size: 0.9rem; font-weight: 700; text-align: right; color: var(--text-main); }
161
+
144
162
  table {
145
163
  width: 100%;
146
164
  border-collapse: collapse;
@@ -148,12 +166,11 @@ try {
148
166
  border: 1px solid var(--border);
149
167
  border-radius: 8px;
150
168
  overflow: hidden;
151
- margin-bottom: 2rem;
152
169
  }
153
170
  th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
154
171
  th { background-color: #111827; font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
155
172
  tr:last-child td { border-bottom: none; }
156
- .total-row { font-weight: 700; background-color: #1e293b; }
173
+ .total-row { font-weight: 700; background-color: #2a3342; }
157
174
  </style>
158
175
  </head>
159
176
  <body>
@@ -192,6 +209,40 @@ try {
192
209
  </div>
193
210
  </div>
194
211
 
212
+ <h2>\u{1F4C8} Latency Distribution Graph</h2>
213
+ <div class="chart-section">
214
+ <div class="chart-row">
215
+ <div class="chart-label">Minimum</div>
216
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pctMin}%;"></div></div>
217
+ <div class="chart-value-tag">${minLatency.toFixed(1)} ms</div>
218
+ </div>
219
+ <div class="chart-row">
220
+ <div class="chart-label">Average</div>
221
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pctAvg}%;"></div></div>
222
+ <div class="chart-value-tag">${avgLatency.toFixed(1)} ms</div>
223
+ </div>
224
+ <div class="chart-row">
225
+ <div class="chart-label">90% Line</div>
226
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pct90}%;"></div></div>
227
+ <div class="chart-value-tag">${p90.toFixed(1)} ms</div>
228
+ </div>
229
+ <div class="chart-row">
230
+ <div class="chart-label">95% Line</div>
231
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pct95}%;"></div></div>
232
+ <div class="chart-value-tag">${p95.toFixed(1)} ms</div>
233
+ </div>
234
+ <div class="chart-row">
235
+ <div class="chart-label">99% Line</div>
236
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pct99}%;"></div></div>
237
+ <div class="chart-value-tag">${p99.toFixed(1)} ms</div>
238
+ </div>
239
+ <div class="chart-row">
240
+ <div class="chart-label">Maximum</div>
241
+ <div class="chart-bar-wrapper"><div class="chart-bar" style="width: ${pctMax}%;"></div></div>
242
+ <div class="chart-value-tag">${maxLatency.toFixed(1)} ms</div>
243
+ </div>
244
+ </div>
245
+
195
246
  <h2>Performance Breakdown Table</h2>
196
247
  <table>
197
248
  <thead>
@@ -236,7 +287,7 @@ try {
236
287
  </body>
237
288
  </html>`;
238
289
  fs.writeFileSync(htmlOutputPath, htmlContent, "utf-8");
239
- console.log(`\u2728 \x1B[32mHTML Dashboard successfully saved to:\x1B[0m ${htmlOutputPath}
290
+ console.log(`\u2728 \x1B[32mHTML Dashboard with Latency Graph saved to:\x1B[0m ${htmlOutputPath}
240
291
  `);
241
292
  } catch (error) {
242
293
  console.error("Execution error:", error);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blaze-performance-tester",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "A high-performance, multi-threaded load testing engine built with Rust and QuickJS.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
File without changes