1#[derive(Debug, Default, Clone)]
2pub struct Cpu {
3 pub name: String,
4 pub user: u64,
5 pub nice: u64,
6 pub system: u64,
7 pub idle: u64,
8 pub iowait: u64,
9 pub irq: u64,
10 pub softirq: u64,
11 pub steal: u64,
12 pub guest: u64,
14 pub guest_nice: u64,
15 #[cfg(feature = "has_stat_cguest")]
16 pub cguest: u64,
17}
18
19#[derive(Debug, Default, Clone)]
20pub struct Stat {
21 pub cpu: Cpu,
23 pub cpus: Vec<Cpu>,
25 pub ctxt: u64,
27 #[cfg(feature = "has_stat_btime")]
29 pub btime: u32,
30 pub processes: u32,
33 #[cfg(feature = "has_stat_procs_running")]
36 pub procs_running: u32,
37 #[cfg(feature = "has_stat_procs_blocked")]
40 pub procs_blocked: u32,
41}
42
43impl Stat {
44 pub fn with_capacity(n: usize) -> Self {
45 Self {
46 cpus: Vec::with_capacity(n),
47 ..Self::default()
48 }
49 }
50}