(history: &mut VecDeque<u64>, value: u64)
| 105 | } |
| 106 | |
| 107 | fn push_history(history: &mut VecDeque<u64>, value: u64) { |
| 108 | if history.len() == HISTORY_SAMPLES { |
| 109 | history.pop_front(); |
| 110 | } |
| 111 | history.push_back(value); |
| 112 | } |
| 113 | |
| 114 | fn cpu_label(cpu: Option<f64>) -> String { |
| 115 | cpu.map(|value| format!("{value:.1}% (100% = one core)")) |