mirror of
https://github.com/nicolargo/glances.git
synced 2026-03-15 12:27:24 -04:00
core/glances_client_browser.py: fix cpu stat visualization under python3
This commit is contained in:
@@ -100,11 +100,10 @@ class GlancesClientBrowser(object):
|
||||
# LOAD
|
||||
v['load_min5'] = json.loads(s.getLoad())['min5']
|
||||
# CPU%
|
||||
v['cpu_percent'] = 100 - \
|
||||
json.loads(s.getCpu())['idle']
|
||||
cpu_percent = 100 - json.loads(s.getCpu())['idle']
|
||||
v['cpu_percent'] = '{0:.1f}'.format(cpu_percent)
|
||||
# MEM%
|
||||
v['mem_percent'] = json.loads(
|
||||
s.getMem())['percent']
|
||||
v['mem_percent'] = json.loads(s.getMem())['percent']
|
||||
# OS (Human Readable name)
|
||||
v['hr_name'] = json.loads(s.getSystem())['hr_name']
|
||||
# Status
|
||||
|
||||
Reference in New Issue
Block a user