From f7887117c5269ed0336cc058c78c4b222e0e6b34 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 18 Feb 2026 14:14:52 +0200 Subject: feat: add disk I/O stats (read/write throughput bars, hotkey 5, auto-scale) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/constants/constants.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/constants') 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) -- cgit v1.2.3