procsys 0.7.0

Rust library to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys
Documentation
use procsys::sysfs;

fn main() {
    let clocksources = sysfs::clocksource::collect().expect("clock source information");

    for clock_src in &clocksources {
        println!("name: {}", clock_src.name);
        println!(
            "available clocksource: {}",
            clock_src.available_clocksource.join(" "),
        );
        println!("current clocksource: {}", clock_src.current_clocksource);
    }

    // print all clocksources information in json output
    match serde_json::to_string_pretty(&clocksources) {
        Ok(output) => println!("{}", output),
        Err(err) => {
            log::error!("{}", err);
            std::process::exit(1);
        }
    }
}