summaryrefslogtreecommitdiff
path: root/internal/constants/constants.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/constants/constants.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/constants/constants.go')
-rw-r--r--internal/constants/constants.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/constants/constants.go b/internal/constants/constants.go
index 48d6e12..3f53cd0 100644
--- a/internal/constants/constants.go
+++ b/internal/constants/constants.go
@@ -24,6 +24,14 @@ const (
CPUModeCount = 3 // Total number of CPU modes for cycling
)
+// DiskMode controls which disk I/O bars are displayed (cycles with the 5 key).
+const (
+ DiskModeAggregate = 0 // Show one bar per host summing all whole-disk devices
+ DiskModeDevices = 1 // Show one bar per whole-disk device per host
+ DiskModeOff = 2 // Hide disk bars entirely (default)
+ DiskModeCount = 3 // Total number of disk modes for cycling
+)
+
// Exit codes
const (
Success = 0
@@ -58,6 +66,9 @@ var (
Yellow0 = RGB{0xff, 0xa0, 0x00}
Yellow = RGB{0xff, 0xc0, 0x00}
Teal = RGB{0x00, 0xcc, 0xcc} // Load average bar fill
+ DiskRead = RGB{0x90, 0x00, 0xd0} // Purple for disk read throughput
+ DiskWrite = RGB{0x60, 0x00, 0x90} // Darker purple for disk write throughput
+ DiskUtil = RGB{0xff, 0x60, 0x60} // Light red for disk utilization % overlay
)
// BytesPerSec for link speed reference (bytes per second at given mbit)