From ecf306d043b62c1646a95027b4e2144be7c69178 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 16 Oct 2026 09:50:42 +0200 Subject: feat(perf): the performance page moves to the drawer, with ~/.cache The island's performance icon and panel are gone: the drawer page covers them. With only one host left, the panel drops its three-column grid for one card per row at a larger size, since the page scrolls; temperatures get a card of their own as tiles. The files move from island/perf to modules/perf. A cache card ports conky's: ~/.cache and its five largest children, measured with du each time the page opens (28ms over 2 GiB here) rather than read from conky's 15-minute sampler file. The largest is yellow, red past half the total, as conky had it. The warning dot now shows only on the drawer tile. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/perf/test_perf.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'desktop/modules/perf/test_perf.js') diff --git a/desktop/modules/perf/test_perf.js b/desktop/modules/perf/test_perf.js index 5f39f5d..ac5859d 100644 --- a/desktop/modules/perf/test_perf.js +++ b/desktop/modules/perf/test_perf.js @@ -9,7 +9,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// Run: node desktop/island/perf/test_perf.js +// Run: node desktop/modules/perf/test_perf.js // Perf.js is a QML library, so its .pragma line is stripped before node // evaluates it, as test_controls.js does for Controls.js. @@ -19,7 +19,7 @@ const assert = require("assert"); const src = fs.readFileSync(__dirname + "/Perf.js", "utf8") .replace(/^\.pragma library$/m, ""); const P = new Function(src + "\nreturn { cpuTimes, load, meminfo, df, vram, rate, " + - "hwmonMap, lanAddr, cpuModel, band, worst, isIPv4, parsePubip, formatPubip, " + + "hwmonMap, lanAddr, cpuModel, du, band, worst, isIPv4, parsePubip, formatPubip, " + "ipCheck, due, push, bytes, speed };")(); // cpuTimes: aggregate first, then cores; idle is idle + iowait. @@ -150,4 +150,10 @@ assert.strictEqual(P.bytes(null), "--"); assert.strictEqual(P.speed(1024 * 1024 * 1.2), "1.2M/s"); assert.strictEqual(P.speed(null), "--"); +// du: total is the directory's own (largest) line; children largest first. +const cache = P.du("5\t/c/b\n9\t/c/a b\n20\t/c\n"); +assert.strictEqual(cache.total, 20); +assert.deepStrictEqual(cache.items, [{ name: "a b", bytes: 9 }, { name: "b", bytes: 5 }]); +assert.strictEqual(P.du(""), null); + console.log("test_perf: ok"); -- cgit v1.2.3