summaryrefslogtreecommitdiff
path: root/internal/stats/stats.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-18 14:14:52 +0200
committerPaul Buetow <paul@buetow.org>2026-02-18 14:14:52 +0200
commitf7887117c5269ed0336cc058c78c4b222e0e6b34 (patch)
tree53e9c4b5163b29b0987beda78572ecdb13c31cf0 /internal/stats/stats.go
parent69f5017434298f1ffd4cdc30c30b95d0f4bd344f (diff)
feat: add disk I/O stats (read/write throughput bars, hotkey 5, auto-scale)
Add a new disk stats category that reads /proc/diskstats, shows read/write throughput as colored bars (purple/darker purple like network RX/TX), with optional utilization % overlay in extended mode. Hotkey 5 cycles: aggregate (sum all whole-disk devices) → per-device → off. Auto-scale with decay and optional fixed override via --diskmax / diskmax config key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/stats/stats.go')
-rw-r--r--internal/stats/stats.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/stats/stats.go b/internal/stats/stats.go
index ebb81b3..463268f 100644
--- a/internal/stats/stats.go
+++ b/internal/stats/stats.go
@@ -11,12 +11,21 @@ type NetStamp struct {
Stamp float64
}
+// DiskStamp holds disk I/O stats and timestamp for delta calculation.
+type DiskStamp struct {
+ SectorsRead int64
+ SectorsWrite int64
+ IoTicks int64
+ Stamp float64
+}
+
// HostStats holds the latest stats for one host (read-only snapshot).
type HostStats struct {
LoadAvg1, LoadAvg5, LoadAvg15 string
Mem map[string]int64
Net map[string]NetStamp
CPU map[string]collector.CPULine
+ Disk map[string]DiskStamp
}
// Source is the interface the display uses to read current stats.