Skip to content

Commit 213c6e2

Browse files
Updated UI colors; Added downloadable json summary report
1 parent 17c7c7f commit 213c6e2

File tree

2 files changed

+78
-9
lines changed

2 files changed

+78
-9
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,35 @@ The CSV includes the following headers:
488488
489489
*Tip: Enable the **Append to existing file** option to run a series of varying workloads (e.g., ramping up concurrency from 4 to 16 to 64) and capture the entire progression in a single, unbroken CSV file for easy graphing!*
490490
491+
## Post-Run JSON Summary Report
492+
If you forget to enable the real-time CSV export, or if you just want a clean summary of your final results, PLGM provides a Download Summary Report button in the Web UI that appears the moment a workload finishes.
493+
494+
This generates a downloadable JSON summary report that captures both the final performance metrics (total ops, average latencies, and throughput per operation type) alongside the exact configuration parameters used to achieve those results. Passwords are automatically redacted from this file for safe sharing.
495+
496+
Example Summary Snippet:
497+
498+
```json
499+
{
500+
"generated_at": "2026-03-12T20:32:00.409Z",
501+
"duration_seconds": "10.51",
502+
"total_operations": 2159,
503+
"average_throughput_ops_sec": "205.50",
504+
"average_throughput_per_op": {
505+
"find": "59.56",
506+
"insert": "109.42",
507+
"update": "23.69",
508+
"delete": "12.75"
509+
},
510+
"operations": { ... },
511+
"average_latencies_ms": { ... },
512+
"configuration": {
513+
"concurrency": "4",
514+
"find_batch_size": "10",
515+
"password": "********"
516+
}
517+
}
518+
```
519+
491520
### Workload Configuration & Loading
492521
493522
You can supply your own collections and queries using the `PLGM_COLLECTIONS_PATH` and `PLGM_QUERIES_PATH` environment variables (or the corresponding config file fields).

internal/webui/static/index.html

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--p-aqua: #30d1b2;
2020
--p-stone: #697793;
2121
--p-amethyst: #8b5cf6;
22+
--p-forest: #059669;
2223

2324
/* UI Variables */
2425
--bg: #f4f6f8;
@@ -262,6 +263,16 @@
262263
box-shadow: var(--elevation-2);
263264
}
264265

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+
265276
.btn-danger {
266277
background: var(--p-fire);
267278
color: white;
@@ -272,6 +283,27 @@
272283
box-shadow: var(--elevation-2);
273284
}
274285

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+
275307
.btn-flat {
276308
background: transparent;
277309
color: var(--p-night);
@@ -302,7 +334,7 @@
302334
.progress-bar {
303335
width: 0%;
304336
height: 100%;
305-
background: var(--p-sunset);
337+
background: var(--p-forest);
306338
transition: width 0.3s ease;
307339
}
308340

@@ -493,11 +525,9 @@ <h1>Percona Load Generator for MongoDB (PLGM)</h1>
493525
<div id="timerDisplay" class="timer-text">00:00 / 00:00</div>
494526
</div>
495527

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">
499529
<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;">
501531
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
502532
<polyline points="16 17 21 12 16 7"></polyline>
503533
<line x1="21" y1="12" x2="9" y2="12"></line>
@@ -592,18 +622,20 @@ <h1>Percona Load Generator for MongoDB (PLGM)</h1>
592622
</div>
593623

594624
<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()"
596626
style="margin-right: auto; float: left;">
597627
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
598628
stroke-linecap="round" stroke-linejoin="round" style="vertical-align: text-bottom; margin-right: 4px;">
599629
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
600630
<polyline points="7 10 12 15 17 10"></polyline>
601631
<line x1="12" y1="15" x2="12" y2="3"></line>
602632
</svg>
603-
Download Summary Report
633+
Download Summary
604634
</button>
605635

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+
607639
<button type="button" class="btn btn-primary" onclick="runAgain()" style="margin-left: 10px;">Run Again</button>
608640
</div>
609641
</div>
@@ -1260,11 +1292,19 @@ <h3 style="display: flex; align-items: center; gap: 8px; margin-bottom: 16px;">
12601292

12611293
// --- CAPTURE FINAL REPORT DATA ---
12621294
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+
12631297
finalReportData = {
12641298
generated_at: new Date().toISOString(),
12651299
duration_seconds: elapsed.toFixed(2),
12661300
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+
},
12681308
operations: {
12691309
find: stats.findOps || 0,
12701310
insert: stats.insertOps || 0,

0 commit comments

Comments
 (0)