mirror of https://github.com/nicolargo/glances
Display IOWait on the PerCpu view
parent
00bd5aad2b
commit
68e84d435f
1
NEWS
1
NEWS
|
@ -6,6 +6,7 @@ Version 1.6
|
|||
* Add per process IO (read and write) rate in B per second
|
||||
IO rate only available on Linux from a root account
|
||||
* If CPU iowait alert then sort by processes by IO rate
|
||||
* Per CPU display IOwait (if data is available)
|
||||
* Process column style auto (underline) or manual (bold)
|
||||
* Display a sort indicator (is space is available)
|
||||
* Change the table key in the help screen
|
||||
|
|
|
@ -1,10 +1,3 @@
|
|||
[global]
|
||||
# Defaults limits for all the stats in %
|
||||
# Defaults values if not defined: 50/70/90
|
||||
careful=50
|
||||
warning=70
|
||||
critical=90
|
||||
|
||||
[cpu]
|
||||
# Limits values for CPU user in %
|
||||
# Defaults values if not defined: 50/70/90
|
||||
|
@ -17,18 +10,20 @@ system_careful=50
|
|||
system_warning=70
|
||||
system_critical=90
|
||||
# Limits values for CPU iowait in %
|
||||
# Defaults values if not defined: TO BE DONE
|
||||
# If your I/O wait percentage is greater than (1/# of CPU cores)
|
||||
# then your CPUs are waiting a significant amount of time for the
|
||||
# disk subsystem to catch up.
|
||||
# Defaults values if not defined: 40/60/80
|
||||
# Not easy to tweek...
|
||||
# Source: http://blog.scoutapp.com/articles/2011/02/10/understanding-disk-i-o-when-should-you-be-worried
|
||||
iowait_careful=15
|
||||
iowait_warning=25
|
||||
iowait_critical=35
|
||||
# http://blog.logicmonitor.com/2011/04/20/troubleshooting-server-performance-and-application-monitoring-a-real-example/
|
||||
# http://blog.developpeur-neurasthenique.fr/auto-hebergement-iowait-ma-tuer-1-2-vmstat-mpstat-atop-pidstat.html (FR)
|
||||
iowait_careful=40
|
||||
iowait_warning=60
|
||||
iowait_critical=80
|
||||
|
||||
[load]
|
||||
# Value * Core
|
||||
# Defaults values if not defined: 0.7/1.0/5.0 per Core
|
||||
# Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages
|
||||
# http://www.linuxjournal.com/article/9001
|
||||
careful=0.7
|
||||
warning=1.0
|
||||
critical=5.0
|
||||
|
|
|
@ -313,6 +313,7 @@ class glancesLimits:
|
|||
def getCritical(self, stat):
|
||||
return self.__limits_list[stat][2]
|
||||
|
||||
# TO BE DELETED AFTER THE HTML output refactoring
|
||||
def getSTDCareful(self):
|
||||
return self.getCareful('STD')
|
||||
|
||||
|
@ -321,6 +322,7 @@ class glancesLimits:
|
|||
|
||||
def getSTDCritical(self):
|
||||
return self.getCritical('STD')
|
||||
# /TO BE DELETED AFTER THE HTML output refactoring
|
||||
|
||||
def getCPUCareful(self, stat):
|
||||
return self.getCareful('CPU_' + stat.upper())
|
||||
|
@ -904,6 +906,15 @@ class GlancesStats:
|
|||
if hasattr(self.percputime_new[i], 'nice'):
|
||||
cpu['nice'] = (self.percputime_new[i].nice -
|
||||
self.percputime_old[i].nice) * perpercent[i]
|
||||
if hasattr(self.percputime_new[i], 'iowait'):
|
||||
cpu['iowait'] = (self.percputime_new[i].iowait -
|
||||
self.percputime_old[i].iowait) * perpercent[i]
|
||||
if hasattr(self.percputime_new[i], 'irq'):
|
||||
cpu['irq'] = (self.percputime_new[i].irq -
|
||||
self.percputime_old[i].irq) * perpercent[i]
|
||||
if hasattr(self.percputime_new[i], 'softirq'):
|
||||
cpu['softirq'] = (self.percputime_new[i].softirq -
|
||||
self.percputime_old[i].softirq) * perpercent[i]
|
||||
self.percpu.append(cpu)
|
||||
self.percputime_old = self.percputime_new
|
||||
self.percputime_total_old = self.percputime_total_new
|
||||
|
@ -1827,11 +1838,15 @@ class glancesScreen:
|
|||
return 0
|
||||
|
||||
self.term_window.addnstr(self.cpu_y + 1, self.cpu_x,
|
||||
_("user:"), 5)
|
||||
_("user:"), 7)
|
||||
self.term_window.addnstr(self.cpu_y + 2, self.cpu_x,
|
||||
_("system:"), 7)
|
||||
if 'iowait' in percpu[0]:
|
||||
self.term_window.addnstr(self.cpu_y + 3, self.cpu_x,
|
||||
_("idle:"), 5)
|
||||
_("iowait:"), 7)
|
||||
else:
|
||||
self.term_window.addnstr(self.cpu_y + 3, self.cpu_x,
|
||||
_("idle:"), 7)
|
||||
|
||||
for i in range(len(percpu)):
|
||||
# percentage of usage
|
||||
|
@ -1851,6 +1866,14 @@ class glancesScreen:
|
|||
format(percpu[i]['system'] / 100, '>6.1%'), 6,
|
||||
self.__getCpuColor2(percpu[i]['system'], stat = 'system'))
|
||||
|
||||
if 'iowait' in percpu[i]:
|
||||
# iowait
|
||||
self.term_window.addnstr(
|
||||
self.cpu_y + 3, self.cpu_x + 8 + i * 8,
|
||||
format(percpu[i]['iowait'] / 100, '>6.1%'), 6,
|
||||
self.__getCpuColor2(percpu[i]['iowait'], stat = 'iowait'))
|
||||
|
||||
else:
|
||||
# idle
|
||||
self.term_window.addnstr(
|
||||
self.cpu_y + 3, self.cpu_x + 8 + i * 8,
|
||||
|
@ -2704,16 +2727,7 @@ class glancesScreen:
|
|||
_("WARNING "), 8, self.ifWARNING_color)
|
||||
self.term_window.addnstr(limits_table_y, limits_table_x + 42,
|
||||
_("CRITICAL"), 8, self.ifCRITICAL_color)
|
||||
#~ limits_table_y += 1
|
||||
#~ self.term_window.addnstr(
|
||||
#~ limits_table_y, limits_table_x,
|
||||
#~ "{0:16} {1:^{width}}{2:^{width}}{3:^{width}}{4:^{width}}".format(
|
||||
#~ _("Default %"),
|
||||
#~ '0',
|
||||
#~ limits.getSTDCareful(),
|
||||
#~ limits.getSTDWarning(),
|
||||
#~ limits.getSTDCritical(),
|
||||
#~ width=width), 79)
|
||||
|
||||
limits_table_y += 1
|
||||
self.term_window.addnstr(
|
||||
limits_table_y, limits_table_x,
|
||||
|
@ -3274,10 +3288,10 @@ def printVersion():
|
|||
|
||||
def printSyntax():
|
||||
printVersion()
|
||||
print(_("Usage: glances [-f file] [-o output] [-t sec] [-h] [-v] ..."))
|
||||
print("")
|
||||
print(_("Usage: glances [opt]"))
|
||||
print(_(" with opt:"))
|
||||
print(_("\t-b\t\tDisplay network rate in Byte per second"))
|
||||
print(_("\t-B IP|NAME\tBind server to the given IP or host NAME"))
|
||||
print(_("\t-B @IP|host\tBind server to the given IP or host NAME"))
|
||||
print(_("\t-c @IP|host\tConnect to a Glances server"))
|
||||
print(_("\t-C file\t\tPath to the configuration file (default: %s)") %
|
||||
default_conf_file)
|
||||
|
@ -3299,7 +3313,6 @@ def printSyntax():
|
|||
def end():
|
||||
if server_tag:
|
||||
# Stop the server loop
|
||||
#~ print(_("Stop Glances server"))
|
||||
server.server_close()
|
||||
else:
|
||||
if client_tag:
|
||||
|
|
Loading…
Reference in New Issue