feat(stats): expose root-filesystem disk usage in stats RPC and UI #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_disk_stats_and_caps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds
disk_total_gb/disk_used_gb/disk_pctto theNodeKVS record and thestatsRPC response, computed every 30 s from sysinfo'sDisksAPI (picks the disk mounted on/, falls back to the largest disk if no/is reported). The UI sidebar gains a Disk gauge widget next to Memory and CPU; the per-node detail table gains Disk rows.Files
crates/hero_codescalers_server/src/model/node.rs— three new fields onNode,#[serde(default)]so pre-existing KVS records still deserialize.crates/hero_codescalers_server/src/main.rs—root_disk_usage()helper + extendednode_update_stats()signature; the periodic stats updater task now refreshes disks too.crates/hero_codescalers_server/openrpc.json— documents the new fields on thestatsresult.crates/hero_codescalers_ui/templates/index.html+static/js/dashboard.js— Disk widget + sparkline, plus disk rows in the node-detail table.Verified
Live on kristof4:
disk_total_gb=948.62,disk_used_gb=107.39,disk_pct=11.32. RPC + UI both render correctly.Notes
#[serde(default)]on the new fields means existingNoderecords still parse — they just report 0.0 until the next 30 s refresh fires.tracing::warn!.