diff --git a/scripts/testes.py b/scripts/testes.py index fe8010a..587cf2a 100644 --- a/scripts/testes.py +++ b/scripts/testes.py @@ -114,14 +114,9 @@ def get_resource_usage(): def get_cpu_usage(stats): UsageDelta = stats['cpu_stats']['cpu_usage']['total_usage'] - stats['precpu_stats']['cpu_usage']['total_usage'] - - SystemDelta = stats['cpu_stats']['cpu_usage']['system_cpu_usage'] - stats['precpu_stats']['cpu_usage']['system_cpu_usage'] - - len_cpu = len(stats['cpu_stats']['cpu_usage']['percpu_usage']) - + SystemDelta = stats['cpu_stats']['system_cpu_usage'] - stats['precpu_stats']['system_cpu_usage'] + len_cpu = stats['cpu_stats']['online_cpus'] percentage = (UsageDelta / SystemDelta) * len_cpu * 100 - - # percent = round(percentage, 2) return f"{percentage:.2f}" def get_ram_usage(stats):