summaryrefslogtreecommitdiff
path: root/internal/collector/scriptdata/loadbars-remote.sh
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/collector/scriptdata/loadbars-remote.sh
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/collector/scriptdata/loadbars-remote.sh')
-rw-r--r--internal/collector/scriptdata/loadbars-remote.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/collector/scriptdata/loadbars-remote.sh b/internal/collector/scriptdata/loadbars-remote.sh
index 9037ad8..1bdb661 100644
--- a/internal/collector/scriptdata/loadbars-remote.sh
+++ b/internal/collector/scriptdata/loadbars-remote.sh
@@ -26,6 +26,16 @@ while true; do
fi
done < <(tail -n +3 /proc/net/dev 2>/dev/null)
+ # Disk: /proc/diskstats, one line per block device with cumulative counters
+ echo "M DISKSTATS"
+ while IFS= read -r line; do
+ set -- $line
+ # $1=major $2=minor $3=device $4=reads_completed $5=reads_merged
+ # $6=sectors_read $7=ms_reading $8=writes_completed $9=writes_merged
+ # $10=sectors_written $11=ms_writing $12=ios_in_progress $13=ms_io
+ [ -n "$3" ] && echo "$3:rs=${6:-0};ws=${10:-0};rt=${7:-0};wt=${11:-0};io=${13:-0}"
+ done < /proc/diskstats 2>/dev/null
+
# CPU: /proc/stat, 20 times with INTERVAL sleep
echo "M CPUSTATS"
for _ in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do