From 6849707c43bb8b87f9913fc26b6a69d51777d209 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 13 Oct 2026 11:30:07 +0200 Subject: fix(perf): review findings in the service and the panel - The panel loads only while open. Its models are fresh arrays every sample, so a hidden instance rebuilt its rows every 2s for the whole session. - The public IP fetch never kills one already running, and waits 30 minutes from the last attempt, not the last success: a rate-limited or offline fetch was retried every minute. - curl -4, so an IPv6 answer cannot silently stall the VPN check. - CPU load sums only the first eight /proc/stat fields. guest and guest_nice are already inside user and nice, and counting them again read high while VMs ran. - df gets timeout -k; the VRAM scan is not restarted over itself. - The GPU name joins the host constants in Perf.qml. Co-Authored-By: Claude Opus 5.5 --- desktop/island/perf/Perf.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'desktop/island/perf/Perf.js') diff --git a/desktop/island/perf/Perf.js b/desktop/island/perf/Perf.js index d23d900..b853f50 100644 --- a/desktop/island/perf/Perf.js +++ b/desktop/island/perf/Perf.js @@ -23,7 +23,9 @@ const UNITS = { "": 1, B: 1, KiB: 1024, MiB: 1024 ** 2, GiB: 1024 ** 3 }; const STALE = 4 * 3600; // One {total, idle} per cpu line of /proc/stat; index 0 is the aggregate, -// then the cores in file order. idle counts iowait, as conky did. +// then the cores in file order. idle counts iowait, as conky did. Only the +// first eight fields are summed: guest and guest_nice are already inside +// user and nice, and adding them again overstates load while VMs run. function cpuTimes(stat) { const out = []; for (const line of stat.split("\n")) { @@ -31,7 +33,7 @@ function cpuTimes(stat) { if (!m) continue; const v = m[1].trim().split(/\s+/).map(Number); if (v.length < 5) continue; - out.push({ total: v.reduce((a, b) => a + b, 0), idle: v[3] + v[4] }); + out.push({ total: v.slice(0, 8).reduce((a, b) => a + b, 0), idle: v[3] + v[4] }); } return out; } -- cgit v1.2.3