oxedyne/fe2o3/fe2o3_sys/src/lib.rs
1004 bytes, 3 runs
created by r1870400018:10582, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | //! Host-statistics primitives for the Hematite ecosystem. |
| 2 | //! |
| 3 | //! Reads CPU, memory, load average, disk, network and process |
| 4 | //! metrics from the operating system without third-party |
| 5 | //! dependencies. Every sample is captured by parsing the |
| 6 | //! relevant pseudo-file under `/proc` on Linux; support for |
| 7 | //! BSD and macOS will slot in via the same [`Sampler`] trait. |
| 8 | //! |
| 9 | //! Intended consumers include admin dashboards, long-running |
| 10 | //! service processes that want to record their own resource |
| 11 | //! use, and test harnesses that need to confirm a workload's |
| 12 | //! footprint. |
| 13 | //! |
| 14 | //! ```ignore |
| 15 | //! use oxedyne_fe2o3_sys::snapshot::Snapshot; |
| 16 | //! let snap = Snapshot::sample()?; |
| 17 | //! println!("cpu busy {}%", snap.cpu.busy_percent()); |
| 18 | //! ``` |
| 19 | #![forbid(unsafe_code)] |
| 20 | |
| 21 | pub mod cpu; |
| 22 | pub mod disk; |
| 23 | pub mod load; |
| 24 | pub mod mem; |
| 25 | pub mod net; |
| 26 | pub mod parse; |
| 27 | pub mod proc_self; |
| 28 | pub mod resident; |
| 29 | pub mod snapshot; |
| 30 | pub mod uptime; |
| 31 | |
| 32 | /// Root under which every Linux metric source lives. |
| 33 | pub const PROC_ROOT: &str = "/proc"; |