fix(ui): normalise status panel timing bars against slowest task not totalMs
Some checks failed
Build and Push Docker Image / build (push) Successful in 21s
CI / Security audit (push) Successful in 42s
CI / Tests & coverage (push) Failing after 39s

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:
2026-05-17 08:38:57 +01:00
parent abdd0da306
commit 0ea9b769a3

View File

@@ -704,8 +704,9 @@ function renderStatusPanel(data, panel) {
<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-timings">`;
const maxTaskMs = lp.tasks.reduce((max, t) => Math.max(max, t.ms), 1);
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 += `
<div class="timing-row">
<span class="timing-label">${escapeHtml(t.label)}</span>