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}
16
17#[derive(Debug, Default, Clone)]
18pub struct Stat {
19 pub cpu: Cpu,
21 pub cpus: Vec<Cpu>,
23 pub ctxt: u64,
25 #[cfg(feature = "has_stat_btime")]
27 pub btime: u32,
28 pub processes: u32,
31 #[cfg(feature = "has_stat_procs_running")]
34 pub procs_running: u32,
35 #[cfg(feature = "has_stat_procs_blocked")]
38 pub procs_blocked: u32,
39}
40
41impl Stat {
42 pub fn with_capacity(n: usize) -> Self {
43 Self {
44 cpus: Vec::with_capacity(n),
45 ..Self::default()
46 }
47 }
48}