#stats #unix #proc #parser #linux

procstat

Parses the /proc/stat file into a struct

5 stable releases

1.0.4 Sep 19, 2021
1.0.3 Sep 18, 2021
1.0.2 Sep 15, 2021
1.0.0 Sep 14, 2021

#738 in Unix APIs

Download history 14/week @ 2023-12-04 11/week @ 2023-12-11 5/week @ 2023-12-18 13/week @ 2024-01-08 18/week @ 2024-01-15 15/week @ 2024-01-22 10/week @ 2024-02-19 21/week @ 2024-02-26 19/week @ 2024-03-04 33/week @ 2024-03-11

83 downloads per month

MIT license

14KB
346 lines

ProcStat

A simple parser for the /proc/stat file found on all unix based systems.

Specifications for this file can be found on Random Sites Like This.

How to use

Import it into your cargo.toml as a dependency.

[dependencies]
procstat = "1.0.4"

Add it to the entry point of your project

extern crate procstat;
use procstat::ProcStat;

Then call it

...
let proc_stat = ProcStat::read();
let aggregated_cpu_data = proc_stat.cpu;
...

Notes from the author

Code review welcome.

I'm not a full time rust developer by any means so always willing to listen to those who do this more than I.

Stay safe and be good to each other!

No runtime deps