forked from Sysdeploy/idlers-agent
Fix core/thread count calculation
This commit is contained in:
parent
ca77ce4c45
commit
bee43980da
5
agent.py
5
agent.py
|
@ -217,7 +217,10 @@ class ServerData:
|
||||||
if section['DMIType'] == 4: # 4 corresponds to processor
|
if section['DMIType'] == 4: # 4 corresponds to processor
|
||||||
core_count = int(section.get('Core Count', '0'))
|
core_count = int(section.get('Core Count', '0'))
|
||||||
thread_count = int(section.get('Thread Count', '0'))
|
thread_count = int(section.get('Thread Count', '0'))
|
||||||
cpu_count = core_count * thread_count
|
if thread_count:
|
||||||
|
cpu_count += thread_count
|
||||||
|
else:
|
||||||
|
cpu_count += core_count
|
||||||
if cpu_count == 0:
|
if cpu_count == 0:
|
||||||
with open('/proc/cpuinfo', 'r') as f:
|
with open('/proc/cpuinfo', 'r') as f:
|
||||||
cpuinfo = f.read()
|
cpuinfo = f.read()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user