summaryrefslogtreecommitdiffstats
path: root/src/ui/components/kernel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/components/kernel.rs')
-rw-r--r--src/ui/components/kernel.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/components/kernel.rs b/src/ui/components/kernel.rs
index 0ca7cd5..90f05a4 100644
--- a/src/ui/components/kernel.rs
+++ b/src/ui/components/kernel.rs
@@ -163,7 +163,10 @@ impl KernelMetrics {
let iowait_length = cpu_stat
.iowait_time
.saturating_sub(self.cpu_stat[i].iowait_time);
- let bar_length: usize = (((busy_length + iowait_length) as f64
+ let bar_length: usize = ((cpu_stat
+ .busy_time()
+ .saturating_sub(self.cpu_stat[i].busy_time())
+ as f64
/ (cpu_stat
.total_time()
.saturating_sub(self.cpu_stat[i].total_time())) as f64)