Is there a better way to show processor usage in tmux?

Here's a solution that can consume a lot of CPU usage (steal from this article ):

there is a difference in my ubuntu 12 ec2 server

use instead, top -lninstead I have to use top -bn1,

Here is my sibling .tmux.conffile

set -g status-right '#[fg=yellow]#[(getCpuUsage.sh)]'

it actually calls the vertex every 2 seconds and displays all the information about the set, I think it should be less than the processor consumption or use some flag to limit the output of only the top processor cpu uage

+5
source share
4 answers

tmux-mem-cpu-load ++. fork/exec , , , , .

+8

tmux-mem-cpu-load, , rainbarf:

rainbarf

, Perl script, 2 ( , 15 ).

+7

vmstat(1). : , , :

vmstat|while read s;do [[ "$s" =~ ([[:space:]]+[0-9]+){4}$ ]]&&echo $BASH_REMATCH; done
0
  • stat top.
  • 1.
  • 0,
  • "t" .

. + z. .

0

All Articles