linux-procfs

Crates.iolinux-procfs
lib.rslinux-procfs
version0.3.15
sourcesrc
created_at2021-07-01 13:25:27.393757
updated_at2023-02-13 01:21:03.276369
descriptionThe linux-procfs is the data snap library for the `/proc/` filesystem on the linux os.
homepage
repositoryhttps://github.com/aki-akaguma/linux-procfs
max_upload_size
id417438
size1,652,332
(aki-akaguma)

documentation

README

linux-procfs

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

The linux-procfs crate is the data snap library for the /proc/ filesystem on the linux os.

This crate reads from /proc filesystem, scanne it, stores the value into the struct and returns it. This scans and holds only the required values by specifying feature.

Feature

  • minimum support rustc 1.58.1 (db9d1b20b 2022-01-20)

Example

Example 1: load average

use linux_procfs::System;
let mut sys = System::new("/");
let loadavg = sys.get_loadavg();
println!("{}, {}, {}, {}", loadavg.a1, loadavg.a5, loadavg.a15, loadavg.last_pid);

Example 2: disk stats

use linux_procfs::System;
let mut sys = System::new("/");
let diskstats = sys.get_diskstats();
for disk in diskstats.disks {
    println!("{}, {}, {}", disk.name, disk.rblk, disk.wblk);
}

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.

Commit count: 24

cargo fmt