1
0
mirror of https://github.com/danog/ytop.git synced 2024-11-30 04:29:10 +01:00

Add check for length of cpu_percents_percpu

This commit is contained in:
Caleb Bassi 2020-01-18 15:12:21 -08:00
parent c558655aae
commit b888ede904

View File

@ -99,11 +99,16 @@ impl UpdatableWidget for CpuWidget<'_> {
}
if self.show_percpu {
let percpu_percents = self.collector.cpu_percent_percpu().unwrap();
if percpu_percents.len() != self.cpu_count {
// TODO
} else {
#[allow(clippy::needless_range_loop)]
for i in 0..self.cpu_count {
self.percpu_data[i].push((self.update_count as f64, percpu_percents[i].into()));
}
}
}
}
fn get_update_interval(&self) -> Ratio<u64> {
self.update_interval