forked from wathiede/i3xs
Only show latest sample now that we have lots of cores.
This commit is contained in:
parent
0aa7613ace
commit
3f92e9dc10
@ -64,7 +64,7 @@ impl CpuWidget {
|
|||||||
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let last_stats = Self::read_status().unwrap();
|
let last_stats = Self::read_status().unwrap();
|
||||||
let num_samples = 6;
|
let num_samples = 1;
|
||||||
let history = (0..last_stats.len())
|
let history = (0..last_stats.len())
|
||||||
.map(|_| (0..num_samples).map(|_| 0.).collect::<VecDeque<f32>>())
|
.map(|_| (0..num_samples).map(|_| 0.).collect::<VecDeque<f32>>())
|
||||||
.collect::<Vec<VecDeque<f32>>>();
|
.collect::<Vec<VecDeque<f32>>>();
|
||||||
@ -116,7 +116,8 @@ impl CpuWidget {
|
|||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
Some(format!("CPU|{}", graphs.join("|")))
|
let joiner = if self.history[0].len() > 1 { "|" } else { "" };
|
||||||
|
Some(format!("CPU|{}", graphs.join(joiner)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user