aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/perf/Perf.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-13 11:30:07 +0200
committerDanilo M. <danix@danix.xyz>2026-10-13 11:30:07 +0200
commit6849707c43bb8b87f9913fc26b6a69d51777d209 (patch)
treefdf165dd2da7783bf4cadd6fc78e72ef32e69dbe /desktop/island/perf/Perf.js
parent2bec673df8ebcb756ec9b605dd7942018a32fdcb (diff)
downloadquickshell-6849707c43bb8b87f9913fc26b6a69d51777d209.tar.gz
quickshell-6849707c43bb8b87f9913fc26b6a69d51777d209.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/perf/Perf.js')
-rw-r--r--desktop/island/perf/Perf.js6
1 files changed, 4 insertions, 2 deletions
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;
}