From 045e6e5591a732661d178cec83b3833d46a105fa Mon Sep 17 00:00:00 2001 From: Louis PERDEREAU Date: Wed, 30 Oct 2024 00:08:17 +0100 Subject: [PATCH] fix: Patch metrics percent --- src/pvecontrol/cluster.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pvecontrol/cluster.py b/src/pvecontrol/cluster.py index a31b6e1..57bf045 100644 --- a/src/pvecontrol/cluster.py +++ b/src/pvecontrol/cluster.py @@ -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, @@ -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, @@ -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,