fix: show disk usage in the top bar alongside CPU and memory - #67
Merged
Conversation
The panel monitored CPU and memory and hid storage, so the one resource that fills up silently and takes the machine down with it was the one nobody could see. Storage now shows an icon and a usage bar, matching how memory renders. Every indicator key is set explicitly rather than left to its default, because Astra's storage section is built around throughput rather than usage: the update interval is named "Storage IO", the header graph is an IO graph, and the usage percentage ships off. Taking the defaults would have produced a kB/s readout, not a fullness one. Two things are deliberately NOT configured: storage-main -- the device the bar tracks. Left alone the extension resolves the root filesystem itself and stores a persistent per-disk id, which comes out as an NVMe EUI on a laptop and a QEMU disk id on a VM. Pinning it here would stamp one machine's disk onto every machine. The device allowlist -- there isn't one. Devices are excluded by CLASS instead (loop, ram, zram, sr, fd), which means the same thing on bare metal and in a VM, so whatever real disks a host has are simply what is left. A workstation with snaps installed carries 25 loop devices otherwise. Verified on four hosts. The bar reads the root filesystem and nothing else, and storage-main resolved per host without being told: bare metal to eui.ace42e00...-part5, VMs to 0QEMU_QEMU_HARDDISK_drive-scsi0-part1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The panel monitored CPU and memory and hid storage, so the one resource that fills up silently and takes the machine down with it was the one nobody could see.
Storage now shows an icon and a usage bar, matching how memory renders.
Why every key is set explicitly
Astra's storage section is built around throughput, not usage. Its update interval is literally named "Storage IO", the header graph is an IO graph, and the usage percentage ships off. Taking the defaults gives you a kB/s readout, not a fullness one, so all nine keys are stated rather than inherited.
storage-header-showtruestorage-header-barstruestorage-header-percentage/-value/-freefalsestorage-header-io/-io-bars/-graphfalsestorage-ignored-regex^(loop|ram|zram|sr|fd)[0-9]Two things deliberately NOT configured
storage-main-- the device the bar tracks. Left alone, the extension resolves the root filesystem itself and stores a persistent per-disk id. Pinning it here would stamp one machine's disk onto every machine. Observed resolving on its own:eui.ace42e003107a6f02ee4ac0000000001-part50QEMU_QEMU_HARDDISK_drive-scsi0-part1A device allowlist -- there isn't one, and shouldn't be. Devices are excluded by CLASS instead.
loop,ram,zram,srandfdmean the same thing on bare metal and in a VM, so whatever real disks a host has are simply what is left over. A workstation with snaps installed carries 25 loop devices otherwise.That pair is what makes this portable rather than a list copied off one machine.
Verified
Applied on four hosts (one bare metal, three VMs). The bar reads the root filesystem and nothing else. The role run reported all nine keys
changed,failed=0, andtools/ci/run-tests.shis green.One caveat worth recording: Astra keeps a
profilesJSON blob, andConfig.syncCurrentProfile()writes that blob back over the live keys. Reading the extension source, it runs only on import-settings, reset-settings, reset-profile and an explicit profile switch -- never at startup -- and it returns early whenprofilesis empty, which it is on a fresh machine. So these settings survive a shell restart, but a user who switches Astra profiles by hand will revert them.