Skip to content

Commit

Permalink
feat: show cpu cores/threads in summary tab closes #1715
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Jan 27, 2024
1 parent 3ae5824 commit ff0d1f7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion api/tacticalrmm/agents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,20 @@ def cpu_model(self) -> List[str]:
try:
cpus = self.wmi_detail["cpu"]
for cpu in cpus:
ret.append([x["Name"] for x in cpu if "Name" in x][0])
name = [x["Name"] for x in cpu if "Name" in x][0]
lp, nc = "", ""
with suppress(Exception):
lp = [
x["NumberOfLogicalProcessors"]
for x in cpu
if "NumberOfCores" in x
][0]
nc = [x["NumberOfCores"] for x in cpu if "NumberOfCores" in x][0]
if lp and nc:
cpu_string = f"{name}, {nc}C/{lp}T"
else:
cpu_string = name
ret.append(cpu_string)
return ret
except:
return ["unknown cpu model"]
Expand Down

0 comments on commit ff0d1f7

Please sign in to comment.