|
19 | 19 | --p-aqua: #30d1b2; |
20 | 20 | --p-stone: #697793; |
21 | 21 | --p-amethyst: #8b5cf6; |
| 22 | + --p-forest: #059669; |
22 | 23 |
|
23 | 24 | /* UI Variables */ |
24 | 25 | --bg: #f4f6f8; |
|
262 | 263 | box-shadow: var(--elevation-2); |
263 | 264 | } |
264 | 265 |
|
| 266 | + .btn-secondary { |
| 267 | + background: var(--p-stone); |
| 268 | + color: white; |
| 269 | + } |
| 270 | + |
| 271 | + .btn-secondary:hover { |
| 272 | + background: #4a5568; |
| 273 | + box-shadow: var(--elevation-2); |
| 274 | + } |
| 275 | + |
265 | 276 | .btn-danger { |
266 | 277 | background: var(--p-fire); |
267 | 278 | color: white; |
|
272 | 283 | box-shadow: var(--elevation-2); |
273 | 284 | } |
274 | 285 |
|
| 286 | + .btn-exit { |
| 287 | + background: transparent; |
| 288 | + color: var(--p-fire); |
| 289 | + border: 1px solid rgba(242, 69, 0, 0.5); |
| 290 | + padding: 6px 12px; |
| 291 | + font-size: 12px; |
| 292 | + border-radius: 4px; |
| 293 | + font-weight: 500; |
| 294 | + cursor: pointer; |
| 295 | + transition: all 0.2s ease; |
| 296 | + display: flex; |
| 297 | + align-items: center; |
| 298 | + } |
| 299 | + |
| 300 | + .btn-exit:hover { |
| 301 | + background: var(--p-fire); |
| 302 | + color: white; |
| 303 | + border-color: var(--p-fire); |
| 304 | + box-shadow: 0 0 8px rgba(242, 69, 0, 0.4); |
| 305 | + } |
| 306 | + |
275 | 307 | .btn-flat { |
276 | 308 | background: transparent; |
277 | 309 | color: var(--p-night); |
|
302 | 334 | .progress-bar { |
303 | 335 | width: 0%; |
304 | 336 | height: 100%; |
305 | | - background: var(--p-sunset); |
| 337 | + background: var(--p-forest); |
306 | 338 | transition: width 0.3s ease; |
307 | 339 | } |
308 | 340 |
|
@@ -493,11 +525,9 @@ <h1>Percona Load Generator for MongoDB (PLGM)</h1> |
493 | 525 | <div id="timerDisplay" class="timer-text">00:00 / 00:00</div> |
494 | 526 | </div> |
495 | 527 |
|
496 | | - <button type="button" class="btn btn-flat" |
497 | | - style="color: white; border-color: rgba(255,255,255,0.3); padding: 6px 12px; font-size: 12px;" |
498 | | - onclick="shutdownApp()" title="Shut down the PLGM backend"> |
| 528 | + <button type="button" class="btn-exit" onclick="shutdownApp()" title="Shut down the PLGM backend"> |
499 | 529 | <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" |
500 | | - stroke-linecap="round" stroke-linejoin="round" style="vertical-align: middle; margin-right: 4px;"> |
| 530 | + stroke-linecap="round" stroke-linejoin="round" style="margin-right: 6px;"> |
501 | 531 | <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path> |
502 | 532 | <polyline points="16 17 21 12 16 7"></polyline> |
503 | 533 | <line x1="21" y1="12" x2="9" y2="12"></line> |
@@ -592,18 +622,20 @@ <h1>Percona Load Generator for MongoDB (PLGM)</h1> |
592 | 622 | </div> |
593 | 623 |
|
594 | 624 | <div id="finishActions" style="display: none; text-align: right; margin-top: 8px;"> |
595 | | - <button type="button" class="btn btn-flat" onclick="downloadSummaryReport()" |
| 625 | + <button type="button" class="btn btn-secondary" onclick="downloadSummaryReport()" |
596 | 626 | style="margin-right: auto; float: left;"> |
597 | 627 | <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" |
598 | 628 | stroke-linecap="round" stroke-linejoin="round" style="vertical-align: text-bottom; margin-right: 4px;"> |
599 | 629 | <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path> |
600 | 630 | <polyline points="7 10 12 15 17 10"></polyline> |
601 | 631 | <line x1="12" y1="15" x2="12" y2="3"></line> |
602 | 632 | </svg> |
603 | | - Download Summary Report |
| 633 | + Download Summary |
604 | 634 | </button> |
605 | 635 |
|
606 | | - <button type="button" class="btn btn-flat" onclick="showConfigure()">Configure Settings</button> |
| 636 | + <button type="button" class="btn btn-flat" onclick="showConfigure()" |
| 637 | + style="border: 1px solid var(--p-stone); color: var(--p-night);">Configure Settings</button> |
| 638 | + |
607 | 639 | <button type="button" class="btn btn-primary" onclick="runAgain()" style="margin-left: 10px;">Run Again</button> |
608 | 640 | </div> |
609 | 641 | </div> |
@@ -1260,11 +1292,19 @@ <h3 style="display: flex; align-items: center; gap: 8px; margin-bottom: 16px;"> |
1260 | 1292 |
|
1261 | 1293 | // --- CAPTURE FINAL REPORT DATA --- |
1262 | 1294 | const totalOps = (stats.findOps || 0) + (stats.insertOps || 0) + (stats.updateOps || 0) + (stats.upsertOps || 0) + (stats.deleteOps || 0); |
| 1295 | + const safeElapsed = Math.max(1, elapsed); // Prevent division by zero |
| 1296 | + |
1263 | 1297 | finalReportData = { |
1264 | 1298 | generated_at: new Date().toISOString(), |
1265 | 1299 | duration_seconds: elapsed.toFixed(2), |
1266 | 1300 | total_operations: totalOps, |
1267 | | - average_throughput_ops_sec: (totalOps / Math.max(1, elapsed)).toFixed(2), |
| 1301 | + average_throughput_ops_sec: (totalOps / safeElapsed).toFixed(2), |
| 1302 | + average_throughput_per_op: { |
| 1303 | + find: ((stats.findOps || 0) / safeElapsed).toFixed(2), |
| 1304 | + insert: ((stats.insertOps || 0) / safeElapsed).toFixed(2), |
| 1305 | + update: (((stats.updateOps || 0) + (stats.upsertOps || 0)) / safeElapsed).toFixed(2), |
| 1306 | + delete: ((stats.deleteOps || 0) / safeElapsed).toFixed(2) |
| 1307 | + }, |
1268 | 1308 | operations: { |
1269 | 1309 | find: stats.findOps || 0, |
1270 | 1310 | insert: stats.insertOps || 0, |
|
0 commit comments