samoshkin / tmux-plugin-sysstat

Prints CPU usage, memory & swap, load average, net I/O metrics in Tmux status bar
MIT License
157 stars 48 forks source link

stdbuf and mawk cause an extremely long delay in CPU usage updates #16

Open akhan3 opened 5 years ago

akhan3 commented 5 years ago

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.

https://github.com/samoshkin/tmux-plugin-sysstat/blob/29e150f403151f2341f3abcb2b2487a5f011dd23/scripts/cpu_collect.sh#L30-L31

I propose two solutions: