Display 64bit every time on 64bit environment and fix the display of io read/write (issue #469 Thk to Sylvain Mouquet)

This commit is contained in:
Nicolargo 2015-01-01 22:46:25 +01:00
parent c088642ac2
commit db88a3386f
2 changed files with 8 additions and 4 deletions

View File

@ -235,18 +235,18 @@ class Plugin(GlancesPlugin):
# IO read/write
if 'io_counters' in p:
# IO read
io_rs = (p['io_counters'][0] - p['io_counters'][2]) / p['time_since_update']
io_rs = int((p['io_counters'][0] - p['io_counters'][2]) / p['time_since_update'])
if io_rs == 0:
msg = '{0:>6}'.format("0")
else:
msg = '{0:>6}'.format(self.auto_unit(io_rs, low_precision=False))
msg = '{0:>6}'.format(self.auto_unit(io_rs, low_precision=True))
ret.append(self.curse_add_line(msg, optional=True, additional=True))
# IO write
io_ws = (p['io_counters'][1] - p['io_counters'][3]) / p['time_since_update']
io_ws = int((p['io_counters'][1] - p['io_counters'][3]) / p['time_since_update'])
if io_ws == 0:
msg = '{0:>6}'.format("0")
else:
msg = '{0:>6}'.format(self.auto_unit(io_ws, low_precision=False))
msg = '{0:>6}'.format(self.auto_unit(io_ws, low_precision=True))
ret.append(self.curse_add_line(msg, optional=True, additional=True))
else:
msg = '{0:>6}'.format("?")

View File

@ -118,6 +118,10 @@ class Plugin(GlancesPlugin):
elif self.stats['os_name'] == "Windows":
os_version = platform.win32_ver()
self.stats['os_version'] = ' '.join(os_version[::2])
# if the python version is 32 bit perhaps the windows operating system is 64bit
if self.stats['platform'] == '32bit':
if 'PROCESSOR_ARCHITEW6432' in os.environ:
self.stats['platform'] = '64bit'
else:
self.stats['os_version'] = ""
# Add human readable name