summaryrefslogtreecommitdiff
path: root/cmd
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 /cmd
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 'cmd')
-rw-r--r--cmd/loadbars/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/loadbars/main.go b/cmd/loadbars/main.go
index dd86723..bb33ef6 100644
--- a/cmd/loadbars/main.go
+++ b/cmd/loadbars/main.go
@@ -35,6 +35,8 @@ func main() {
flag.StringVar(&cfg.SSHOpts, "sshopts", cfg.SSHOpts, "Set SSH options")
flag.BoolVar(&cfg.HasAgent, "hasagent", cfg.HasAgent, "SSH key already known by agent")
flag.IntVar(&cfg.MaxBarsPerRow, "maxbarsperrow", cfg.MaxBarsPerRow, "Max bars per row (0=unlimited)")
+ flag.IntVar(&cfg.DiskMode, "diskmode", cfg.DiskMode, "Disk display mode (0=aggregate, 1=devices, 2=off)")
+ diskmax := flag.Float64("diskmax", 0, "Fixed disk bar full-height reference in bytes/sec (0 = auto-scale)")
loadmax := flag.Float64("loadmax", 0, "Fixed load bar full-height reference value (0 = auto-scale)")
flag.Parse()
@@ -54,6 +56,9 @@ func main() {
if *loadmax > 0 {
cfg.LoadMax = *loadmax
}
+ if *diskmax > 0 {
+ cfg.DiskMax = *diskmax
+ }
if *cluster != "" {
cfg.Cluster = *cluster
}