summaryrefslogtreecommitdiff
path: root/internal/collector
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-18 19:39:04 +0200
committerPaul Buetow <pbuetow@mimecast.com>2026-02-18 19:39:04 +0200
commit1e0b0f9e9573d1c6188fc683591e1f8ae044ca1f (patch)
tree023bac27dc261ee546572b6c253e647d6a802d99 /internal/collector
parent3cc9d42252b7d5f9c24c10ef748cff1d2e1bbd67 (diff)
Disk I/O: collect stats on remote, dynamic bar count, reset peak on r
- Add M DISKSTATS block to embedded loadbars-remote.sh so disk I/O is collected from /proc/diskstats on remote hosts (was only in scripts/ copy). - Document in countBars that total bars are computed per host (dynamic device count when disk mode is per-device). - Extend r hotkey to reset disk auto-scale peak to 1 MB/s floor when disk bars are on and diskmax is not fixed; update README and help text. Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'internal/collector')
-rw-r--r--internal/collector/loadbars-remote.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/collector/loadbars-remote.sh b/internal/collector/loadbars-remote.sh
index 9037ad8..ccdcbe8 100644
--- a/internal/collector/loadbars-remote.sh
+++ b/internal/collector/loadbars-remote.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# loadbars-remote.sh - Emits loadbars protocol (M LOADAVG, M MEMSTATS, M NETSTATS, M CPUSTATS)
+# loadbars-remote.sh - Emits loadbars protocol (M LOADAVG, M MEMSTATS, M NETSTATS, M DISKSTATS, M CPUSTATS)
# for local or remote execution. No Perl required.
# Usage: bash loadbars-remote.sh
# Interval for CPU sampling (seconds)
@@ -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