procsys 0.7.0

Rust library to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use procsys::process;

fn main() {
    let procs = process::collect_all().expect("system processes");

    for proc in procs {
        println!("pid: {}", proc.pid());
        println!("\t comm: {}", proc.comm().unwrap_or_default());
        println!("\t wchan: {}", proc.wchan().unwrap_or_default());
        println!("\t executable: {:?}", proc.executable().unwrap_or_default());
        println!("\t cwd: {:?}", proc.cwd().unwrap_or_default());
        println!("\t root: {:?}", proc.root_dir().unwrap_or_default());
    }
}