mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-27 19:25:27 +03:00
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:
parent
c088642ac2
commit
db88a3386f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user