Oregami
Repositories/oxedyne/fe2o3

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
21pub mod cpu;
22pub mod disk;
23pub mod load;
24pub mod mem;
25pub mod net;
26pub mod parse;
27pub mod proc_self;
28pub mod resident;
29pub mod snapshot;
30pub mod uptime;
31
32/// Root under which every Linux metric source lives.
33pub const PROC_ROOT: &str = "/proc";