From c3a6c8a69f71da01b518fc3ca10bcaf5a0177859 Mon Sep 17 00:00:00 2001 From: Hengfei Yang Date: Wed, 9 Apr 2025 11:18:00 +0800 Subject: [PATCH] fix: cpu usage (#6495) It should be in 0~100% --- src/config/src/utils/sysinfo/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/src/utils/sysinfo/mod.rs b/src/config/src/utils/sysinfo/mod.rs index 4f992d6391..2bf32d6fb5 100644 --- a/src/config/src/utils/sysinfo/mod.rs +++ b/src/config/src/utils/sysinfo/mod.rs @@ -41,7 +41,7 @@ pub struct NodeMetrics { /// Get the node running metrics pub fn get_node_metrics() -> NodeMetrics { let cpu_total = get_cpu_limit(); - let cpu_usage = get_cpu_usage(); + let cpu_usage = get_cpu_usage() / cpu_total as f32; let memory_total = get_memory_limit(); let memory_usage = get_memory_usage(); let tcp_conns = get_tcp_connections();