Skip to content

Commit

Permalink
Fix stupid bug in NodeHealthStatus computation
Browse files Browse the repository at this point in the history
  • Loading branch information
ccicconetti committed Oct 8, 2024
1 parent 4751312 commit 46c7f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion edgeless_node/src/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl Agent {
disk_tot_reads += disk_usage.total_read_bytes as i64;
disk_tot_writes += disk_usage.total_written_bytes as i64;
}
let num_cpus = std::cmp::min(1, sys.cpus().len()) as f32;
let num_cpus = std::cmp::max(1, sys.cpus().len()) as f32;
let health_status = edgeless_api::node_management::NodeHealthStatus {
cpu_usage: (sys.global_cpu_usage() / num_cpus) as i32,
cpu_load: sys.cpus().iter().map(|x| x.cpu_usage()).sum::<f32>() as i32,
Expand Down

0 comments on commit 46c7f82

Please sign in to comment.