fix(ui): normalise status panel timing bars against slowest task not totalMs
Tasks run in parallel so any individual task time can exceed the wall-clock total, causing all bars to render at 100%. Normalise against the maximum individual task time so bars correctly show relative response times.
This commit is contained in:
+2
-1
@@ -704,8 +704,9 @@ function renderStatusPanel(data, panel) {
|
|||||||
<div class="status-card status-card-wide">
|
<div class="status-card status-card-wide">
|
||||||
<div class="status-card-title">Last Poll (${lp.totalMs}ms total, ${pollAge}s ago)</div>
|
<div class="status-card-title">Last Poll (${lp.totalMs}ms total, ${pollAge}s ago)</div>
|
||||||
<div class="status-timings">`;
|
<div class="status-timings">`;
|
||||||
|
const maxTaskMs = lp.tasks.reduce((max, t) => Math.max(max, t.ms), 1);
|
||||||
for (const t of lp.tasks) {
|
for (const t of lp.tasks) {
|
||||||
const barWidth = lp.totalMs > 0 ? Math.max(2, (t.ms / lp.totalMs) * 100) : 0;
|
const barWidth = Math.max(2, (t.ms / maxTaskMs) * 100);
|
||||||
html += `
|
html += `
|
||||||
<div class="timing-row">
|
<div class="timing-row">
|
||||||
<span class="timing-label">${escapeHtml(t.label)}</span>
|
<span class="timing-label">${escapeHtml(t.label)}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user