Minor changes
This commit is contained in:
parent
db43c985a3
commit
6312f3575a
|
@ -80,14 +80,13 @@ def _parseSysCounters(fn:str):
|
||||||
res[m.group(1).lower()] = int(m.group(2))
|
res[m.group(1).lower()] = int(m.group(2))
|
||||||
|
|
||||||
m = re.match("cpu([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)", line)
|
m = re.match("cpu([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)", line)
|
||||||
res['num'] = int(m.group(1))
|
stat['cpu%d' % int(m.group(1)]['user'] = int(m.group(2))
|
||||||
res['user'] = int(m.group(2))
|
stat['cpu%d' % int(m.group(1)]['nice'] = int(m.group(3))
|
||||||
res['nice'] = int(m.group(3))
|
stat['cpu%d' % int(m.group(1)]['system'] = int(m.group(4))
|
||||||
res['system'] = int(m.group(4))
|
stat['cpu%d' % int(m.group(1)]['idle'] = int(m.group(5))
|
||||||
res['idle'] = int(m.group(5))
|
stat['cpu%d' % int(m.group(1)]['iowait'] = int(m.group(6))
|
||||||
res['iowait'] = int(m.group(6))
|
stat['cpu%d' % int(m.group(1)]['irq'] = int(m.group(7))
|
||||||
res['irq'] = int(m.group(7))
|
stat['cpu%d' % int(m.group(1)]['softirq'] = int(m.group(8))
|
||||||
res['softirq'] = int(m.group(8))
|
|
||||||
|
|
||||||
if (m):
|
if (m):
|
||||||
res[m.group(1)] = int(m.group(2))
|
res[m.group(1)] = int(m.group(2))
|
||||||
|
|
Loading…
Reference in New Issue