Here's a solution which may consume a lot of cpu usage (stolen from this article):
There's a difference in my Ubuntu 12 ec2 server, I have to use top -bn1
instead of top -ln
.
Here's my related .tmux.conf
file:
set -g status-right '#[fg=yellow]#[(getCpuUsage.sh)]'
It actually calls top
every 2 seconds and outputs a whole lot of information. I think there should be a way involving less cpu consumption or use some flag to limit the output of top
to only cpu usage.
Task Manager also offers a way to keep an eye on CPU usage in real-time, provided you can spare some screen real estate. To create a floating CPU monitor, click on the Performance tab of Task Manager, click CPU, then hover your mouse over the charts showing your CPU cores, right-click, and select Graph Summary View.
Running the mpstat command on a Linux system will display an output like the one shown in figure 2. This command shows various CPU statistics including idle time, io wait time and steal time. Similar to the top command, the idle time shown here can be used to compute the CPU utilization using the same formula.
OpManager is both a Linux and Windows CPU usage monitor console. To monitor CPU usage means to monitor the following: CPU utilization: Monitors the CPU utilization of the network device.
I use the small tmux-mem-cpu-load C++ program. It's at least one fork/exec per update either way, but probably better than invoking a shell.
If I knew tmux-mem-cpu-load, I would become too lazy to write my own rainbarf:
It has a fancier look, but it is a Perl script so it is not a good idea to run it every 2 seconds (on my experience, 15 seconds suffice).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With