提交 91e3b2e9 编写于 作者: N Nicolargo

Display 64bit every time on 64bit environment and fix the display of io...

Display 64bit every time on 64bit environment and fix the display of io read/write (issue #469 Thk to Sylvain Mouquet)
上级 35414e9a
......@@ -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("?")
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册