-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
On a system, where mawk
is the default awk
instead of gawk
(for example, Raspbian Stretch), the following will fail to give any output until all the samples are produced. For default settings, this will cause a delay of 60x10 seconds between CPU usage updates.
tmux-plugin-sysstat/scripts/cpu_collect.sh
Lines 30 to 31 in 29e150f
vmstat -n "$refresh_interval" "$samples_count" \ | |
| stdbuf -o0 awk 'NR>2 {print 100-$(NF-2)}' |
I propose two solutions:
- Replace
awk
with/usr/bin/gawk
everywhere in the code and listgawk
as a dependency. - Adapt the code so that
stdbuf
andmawk
can produce streaming output.
wangjiaming0909
Metadata
Metadata
Assignees
Labels
No labels