tmux-plugin-sysstat icon indicating copy to clipboard operation
tmux-plugin-sysstat copied to clipboard

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

Open akhan3 opened this issue 6 years ago • 0 comments

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:

  • Replace awk with /usr/bin/gawk everywhere in the code and list gawk as a dependency.
  • Adapt the code so that stdbuf and mawk can produce streaming output.

akhan3 avatar Sep 23 '19 23:09 akhan3