Commit ef7df864 authored by Mario Hock's avatar Mario Hock

CPU bars: display iowait

parent b7f74b7f
......@@ -52,13 +52,14 @@ def _display_cpu_bar(y, x, cpu):
# Constants
CPU_BAR_COLORS = ( curses.color_pair(3) | curses.A_REVERSE, # user
curses.color_pair(4) | curses.A_REVERSE, # system
curses.color_pair(5) | curses.A_REVERSE, # other
curses.color_pair(5) | curses.A_REVERSE, # iowait
curses.color_pair(6) | curses.A_REVERSE, # other
curses.color_pair(3) ) # idle
# Calculate proportions
cpu_util = 100-cpu.idle
other = 100 - sum( (cpu.user, cpu.system, cpu.idle) )
proportions = [cpu.user, cpu.system, other, cpu.idle]
other = 100 - sum( (cpu.user, cpu.system, cpu.iowait, cpu.idle) )
proportions = [cpu.user, cpu.system, cpu.iowait, other, cpu.idle]
# Prepare text.
text = '{0:.2%}'.format((cpu_util)/100.0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment