diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:18 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:18 +0100 |
| commit | fda4e7847bb5dc985404269c81400eead52b0181 (patch) | |
| tree | 724fb032a3809c9cdde521775b4d4f28ce684c95 /desktop/modules/perf/test_perf.js | |
| parent | 13f04c0d3188f9f974986225486c01f91cd18701 (diff) | |
| download | quickshell-fda4e7847bb5dc985404269c81400eead52b0181.tar.gz quickshell-fda4e7847bb5dc985404269c81400eead52b0181.zip | |
xe exposes no busy percentage, but its DRM fdinfo carries per-engine
cycle counters. vram.sh becomes gpu.sh: the same scan also sums
drm-cycles-rcs/ccs per client and prints them with the GPU's cycle
counter, and Perf.js turns two scans into a percentage per engine.
The GPU card's headline is now the busier engine, with render (games)
and compute (local LLMs) as bars, then VRAM, temperature and fan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/perf/test_perf.js')
| -rw-r--r-- | desktop/modules/perf/test_perf.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/modules/perf/test_perf.js b/desktop/modules/perf/test_perf.js index d5856e8..a1a068d 100644 --- a/desktop/modules/perf/test_perf.js +++ b/desktop/modules/perf/test_perf.js @@ -20,7 +20,7 @@ const src = fs.readFileSync(__dirname + "/Perf.js", "utf8") .replace(/^\.pragma library$/m, ""); const P = new Function(src + "\nreturn { cpuTimes, load, meminfo, df, rate, " + "hwmonMap, lanAddr, cpuModel, du, band, worst, isIPv4, parsePubip, formatPubip, " + - "ipCheck, due, push, bytes, speed, procs, sockets, netProcs };")(); + "ipCheck, due, push, bytes, speed, procs, sockets, netProcs, gpuSample, gpuLoad };")(); // cpuTimes: aggregate first, then cores; idle is idle + iowait. const stat = [ @@ -183,4 +183,11 @@ assert.deepStrictEqual(P.netProcs([{ key: "a", name: "firefox", rx: 5000, tx: 10 [{ name: "firefox", rx: 3000, tx: 0 }]); assert.deepStrictEqual(P.netProcs([], later, 0), []); + +// gpu.sh: five numbers or nothing; load per engine between two scans. +assert.strictEqual(P.gpuSample(""), null); +const g1 = P.gpuSample("100 0 1000 0 1000\n"), g2 = P.gpuSample("100 200 2000 900 2000"); +assert.deepStrictEqual(P.gpuLoad(g1, g2), { render: 20, compute: 90 }); +assert.deepStrictEqual(P.gpuLoad(null, g2), { render: null, compute: null }); +assert.deepStrictEqual(P.gpuLoad(g2, [100, 0, 3000, 0, 2000]), { render: 0, compute: null }); console.log("test_perf: ok"); |
