1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Low-overhead system information collection.
//!
//! Counter models and parsers work without `std` or an allocator.
//! Linux collection is enabled by `std`; the optional `dylib` feature adds
//! shared Linux/macOS/Windows native loading without `std` or an allocator.
//!
//! ```
//! use zsys::cpu::CpuTimes;
//! let before = CpuTimes { user: 100, idle: 900, ..CpuTimes::default() };
//! let after = CpuTimes { user: 150, idle: 950, ..CpuTimes::default() };
//! assert_eq!(after.busy_percent_since(before), Some(50.0));
//! ```
//!
//! ```no_run
//! # #[cfg(all(feature = "std", target_os = "linux"))]
//! # fn main() -> Result<(), zsys::linux::LinuxError> {
//! let mut system = zsys::System::new();
//! system.refresh_memory()?;
//! system.refresh_processes()?;
//! for process in system.processes() {
//! println!("{}: {} bytes", process.id.pid, process.memory_bytes);
//! }
//! # Ok(())
//! # }
//! # #[cfg(not(all(feature = "std", target_os = "linux")))]
//! # fn main() {}
//! ```
extern crate alloc;
pub use System;
pub use ;