Test on DIskIO

This commit is contained in:
Nicolas Hennion 2012-12-24 15:12:38 +01:00
parent c3b42a5fc0
commit e60cb2c139

View File

@ -907,31 +907,31 @@ class GlancesStats:
def getMemSwap(self): def getMemSwap(self):
return self.memswap return self.memswap
def getSensors(self):
if sensors_tag:
return sorted(self.sensors,
key=lambda sensors: sensors['label'])
else:
return 0
def getNetwork(self): def getNetwork(self):
if psutil_network_io_tag: if psutil_network_io_tag:
return sorted(self.network, return sorted(self.network,
key=lambda network: network['interface_name']) key=lambda network: network['interface_name'])
else: else:
return 0 return []
def getSensors(self):
if sensors_tag:
return sorted(self.sensors,
key=lambda sensors: sensors['label'])
else:
return []
def getDiskIO(self): def getDiskIO(self):
if psutil_disk_io_tag: if psutil_disk_io_tag:
return sorted(self.diskio, key=lambda diskio: diskio['disk_name']) return sorted(self.diskio, key=lambda diskio: diskio['disk_name'])
else: else:
return 0 return []
def getFs(self): def getFs(self):
if psutil_fs_usage_tag: if psutil_fs_usage_tag:
return sorted(self.fs, key=lambda fs: fs['mnt_point']) return sorted(self.fs, key=lambda fs: fs['mnt_point'])
else: else:
return 0 return []
def getProcessCount(self): def getProcessCount(self):
return self.processcount return self.processcount
@ -990,10 +990,22 @@ class GlancesStatsServer(GlancesStats):
self.all_stats["load"] = self.load self.all_stats["load"] = self.load
self.all_stats["mem"] = self.mem self.all_stats["mem"] = self.mem
self.all_stats["memswap"] = self.memswap self.all_stats["memswap"] = self.memswap
self.all_stats["network"] = self.network if psutil_network_io_tag:
self.all_stats["sensors"] = self.sensors self.all_stats["network"] = self.network
self.all_stats["diskio"] = self.diskio else:
self.all_stats["fs"] = self.fs self.all_stats["network"] = []
if sensors_tag:
self.all_stats["sensors"] = self.sensors
else:
self.all_stats["sensors"] = []
if psutil_disk_io_tag:
self.all_stats["diskio"] = self.diskio
else:
self.all_stats["diskio"] = []
if psutil_fs_usage_tag:
self.all_stats["fs"] = self.fs
else:
self.all_stats["fs"] = []
self.all_stats["processcount"] = self.processcount self.all_stats["processcount"] = self.processcount
self.all_stats["process"] = self.process self.all_stats["process"] = self.process
self.all_stats["core_number"] = self.core_number self.all_stats["core_number"] = self.core_number
@ -1024,13 +1036,22 @@ class GlancesStatsClient(GlancesStats):
self.load = input_stats["load"] self.load = input_stats["load"]
self.mem = input_stats["mem"] self.mem = input_stats["mem"]
self.memswap = input_stats["memswap"] self.memswap = input_stats["memswap"]
self.network = input_stats["network"] try:
self.network = input_stats["network"]
except:
self.network = []
try: try:
self.sensors = input_stats["sensors"] self.sensors = input_stats["sensors"]
except: except:
self.sensors = {} self.sensors = []
self.diskio = input_stats["diskio"] try:
self.fs = input_stats["fs"] self.diskio = input_stats["diskio"]
except:
self.diskio = []
try:
self.fs = input_stats["fs"]
except:
self.fs = []
self.processcount = input_stats["processcount"] self.processcount = input_stats["processcount"]
self.process = input_stats["process"] self.process = input_stats["process"]
self.core_number = input_stats["core_number"] self.core_number = input_stats["core_number"]