cpu: comment describing fields.

This commit is contained in:
Bill Thiede 2020-11-09 18:58:57 -08:00
parent 4d150ac985
commit 0aa7613ace

View File

@ -50,6 +50,10 @@ impl CpuWidget {
.iter()
.map(|x| u64::from_str_radix(x, 10).unwrap())
.collect::<Vec<_>>();
// [0] user
// [1] nice
// [2] system
// [3] idle
let usage = parsed[0] + parsed[1] + parsed[2];
let total = usage + parsed[3];
stats.push(Stat { usage, total })