Repository navigation
feat(header): opt-in GPU and CPU clock readings after CPU and MEM - #692
Conversation
|
Thank you for this one. It adds opt-in GPU load, VRAM and GPU clock readings plus a CPU clock to the header, read only while the browser asks for them, and the non-WSL paths, the frontend and the tests are in good shape: typecheck, lint, format, the frontend syntax check, the targeted tests and your Chromium test all pass here. Two things in the WSL
Smaller things for the same round:
One question only your hardware can answer: does the WSL CPU MHz reading go above the base clock under load? Task Manager's Speed is the Once the two sampler fixes and their tests are in, this is ready to merge. The bundled change that keeps the stats polling with no session open is fine to keep in this PR; it will get its own line in the release notes. |
|
Thanks @Ark0N. Both sampler fixes and all seven smaller items are in
Your hardware question. I measured on the Intel i7-1255U laptop (base 1700 MHz): Typecheck, lint, prettier, the frontend syntax check, the related unit tests (943) and the Chromium test pass here. |
|
The one failed check on
|
|
Thank you, @opticon454, for this one and for the quick second round. It adds opt-in GPU load, graphics memory and GPU clock readings plus a live CPU clock to the header, read only while the browser asks for them. All nine items from the first round are in A few small things remain. I will apply them at merge time unless you would rather push them yourself:
None of these changes the design. Once they are in, this gets merged. |
…ders, one stats request at a time
|
Thanks @Ark0N. All six are pushed in
Typecheck, lint, prettier, the frontend syntax check, the related unit tests (888 across 47 files) and the Chromium test pass here. |
|
Thank you, @opticon454, for the third round. This PR adds opt-in GPU load, graphics memory and GPU clock readings plus a live CPU clock to the header, read only while the browser asks for them. All six items from the last round are in A few small things remain. I will apply them at merge time, so there is nothing you need to push:
Thanks also for the |
host-sensors: never await the PowerShell RAM probe on a read; keep the resolved total and show the memory in use alone until it answers (test with a held PowerShell) test: rename the Windows sampler test that said the GPU counters are added "for good" test: make host-sensors.test.ts's @fileoverview describe what that file covers host-sensors: make the nvidiaSkipUntil JSDoc describe the back-off deadline docs: Settings Reference says the host readings live inside System Stats and nothing is fetched while it is off Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ss ones at Compact tiny (release review) #689's density steps hide every `.header-system-stats .stat-label` once the toolbar is narrowed, and #692's readings (GPU, VRAM, GPU MHz, CPU MHz) have nothing else naming them: at tight, dense and tiny the header showed "40%" beside CPU's "12%", "3.2G" beside MEM's "7.9G", and two bare "1800 MHz" / "4200 MHz" with no way to tell the GPU clock from the CPU one. At Compact + tiny, where values are hidden too, the two clocks (no ring) were left as 0-px items that still took an 8 px flex gap each. Neither PR shows it alone. - The four host items carry `stat-item--host`, excluded from the density label hide, so they keep their labels at every step. - `stat-item--ringless` (static on the two clocks, toggled by `_updateHostSensors` on VRAM while its total, and so its ring, is unknown) is hidden at Compact + tiny instead of staying an empty item. Tests: the browser test drives every density in all three styles against the real markup and styles.css (it fails on the previous files), and the unit test pins the VRAM ringless toggle. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merged, thank you! This ships in 1.45.0. At merge the stats route stopped waiting on the PowerShell RAM probe: it shows the memory in use until the total answers. The release review found two more things, both fixed:
|
What
Two opt-in header readings after CPU and MEM, both off by default (Settings, Header & Panels):
(Captured on a laptop with an Intel GPU under WSL. Windows publishes no clock for an Intel GPU, so the GPU clock item stays hidden there; NVIDIA and AMD report one.)
Why
The header shows CPU and MEM but nothing about the GPU, and local-model and video work leans on it. The clock speeds are the quickest way to see throttling.
How
GET /api/system/statstakes?gpu=1and?cpumhz=1. Nothing is read, andnvidia-smiortypeperf.exeis never run, unless the browser asks, and it only asks while the matching setting is on. A host without the sensor omits the field and the header shows nothing for it.src/host-sensors.ts(new, pure parsers exported for tests):nvidia-smi, else the amdgpu sysfs files, else, inside WSL, the Windows performance counters throughtypeperf.exe(any vendor). That path gives load and memory in use; the memory total is taken as half of Windows' RAM, the limit Windows applies to integrated GPUs.scaling_cur_freq, else/proc/cpuinfo. Under WSL the Linux side only has a fixed number, so the WindowsProcessor Frequencycounter is used and nothing is shown until it answers.typeperfsample takes over a second, so one long-running sampler is kept, replaced every 30 seconds (its wildcard counters are expanded once, at start) and stopped after 30 seconds with no reads. Reads are cached for 2 seconds.hiddenattribute; a selector that outranks the Tiles style's owndisplaykeeps them hidden there too.CPU --% MEM --until a session existed, and the new items would never have filled in.showGpuStats,showCpuMhz, per device, in the strict settings schema), zh-CN strings, a docs paragraph inSettings-Reference.mdand a changeset.Overlap with open PRs
This touches the shared header and settings files, so it shares files with these open PRs (the list pr-watch reported). The overlaps are small hunks next to theirs (new chips, new header items, new schema keys), not changes to the same lines, and it rebases cleanly on current master. I have not tried it against each of them, and will rebase as they land:
index.html,schemas.ts,system-routes.ts,i18n.js): feat(agent): per-session agent inbox (discussion #558) #690, feat(cli-registry): jcode as a run mode #650, feat(files): load the Files panel one folder at a time, sort it, filter locally #633, feat(files): download and upload files from the path picker #631, feat(mobile): add session file transfer controls #529, feat(adopt): adopt tmux sessions a human started, in all three locations #510 and fix(response-viewer): inspect readable link addresses before navigating #545.styles.css,app.jsorpanels-ui.jsonly: fix(mobile): zoom previews and sync Codex compose #608, fix(sse): retry an EventSource connect attempt that never opens #678, fix(terminal): load tmux history instead of paging Claude after a hollow tab switch #681, fix(mobile): swipe through sessions in the order the strip draws them #682, feat(palette): choose the agent when starting a session from Cmd+K #685 and feat(terminal): link file paths that contain spaces as one path #687.The new items are also written to sit with the header divider in my own #689.
Tests
test/host-sensors.test.ts: the nvidia-smi, amdgpu, cpuinfo and typeperf parsers, and the sampler's life cycle (first sample, recycling, idle stop, back-off after a failed start).test/header-host-sensors-ui.test.ts: both settings off by default, only the requested readings fetched, items shown only when reported, GPU clock follows GPU Stats and CPU clock follows CPU MHz, and the polling with no session.test/routes/system-routes.test.ts: nothing extra without the query, only the requested readings passed on.test/header-host-sensors.browser.test.ts(real Chromium, listed inBROWSER_TEST_GLOBS): unreported items stay hidden under the Compact, Tiles and Classic styles.tsc --noEmit, the frontend syntax check and prettier pass. The GPU path through the Windows counters was run on a real Intel laptop under WSL; the NVIDIA and AMD paths are covered by parser tests only, not real hardware.