Skip to content

Commit

Permalink
fix: Patch metrics percent
Browse files Browse the repository at this point in the history
  • Loading branch information
lperdereau committed Oct 29, 2024
1 parent 8a11685 commit 045e6e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pvecontrol/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def cpu_metrics(self):
nodes = self.get_resources_nodes()
total_cpu = sum([node['maxcpu'] for node in nodes])
total_cpu_usage = sum([node['cpu'] for node in nodes])
cpu_percent = total_cpu_usage / total_cpu
cpu_percent = total_cpu_usage / total_cpu *100

return {
"total": total_cpu,
Expand All @@ -80,7 +80,7 @@ def memory_metrics(self):
nodes = self.get_resources_nodes()
total_memory = sum([node['maxmem'] for node in nodes])
total_memory_usage = sum([node['mem'] for node in nodes])
memory_percent = total_memory_usage / total_memory
memory_percent = total_memory_usage / total_memory *100

return {
"total": total_memory,
Expand All @@ -92,7 +92,7 @@ def disk_metrics(self):
nodes = self.get_resources_nodes()
total_disk = sum([node['maxdisk'] for node in nodes])
total_disk_usage = sum([node['disk'] for node in nodes])
disk_percent = total_disk_usage / total_disk
disk_percent = total_disk_usage / total_disk *100

return {
"total": total_disk,
Expand Down

0 comments on commit 045e6e5

Please sign in to comment.