From 024afc934500a443466d266a83e9ba49ff047c5f Mon Sep 17 00:00:00 2001 From: alemidev Date: Sat, 1 Oct 2022 00:31:59 +0200 Subject: [PATCH] fix: scale cpu x100 --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 3858d90..5e0d558 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,7 +127,7 @@ async fn stats_delta( let cpu_tracker = store_cpu.get_mut(&session).unwrap(); let cpu_stats = cpu_tracker.load.done().map_err(to_403_err)?; - cpu = 1.0 - cpu_stats.idle; + cpu = 100.0 * (1.0 - cpu_stats.idle); let new_cpu = sys.cpu_load_aggregate().map_err(to_403_err)?; store_cpu.insert(session.clone(), CpuDeltaTracker { load: new_cpu });