papertigers / rust-kstat

Rust kstat bindings for illumos based systems
MIT License
4 stars 2 forks source link

kstat

Docs

This rust library provides an ffi wrapper around the native illumos library.

Example

The following is equivalent to kstat -p -n zone_vfs:

extern crate kstat;

use kstat::KstatReader;

fn main() {
    let reader = KstatReader::new(None, None, None, Some("zone_vfs"))
        .expect("failed to create kstat reader");
    let stats = reader.read().expect("failed to read kstats");
    println!("{:#?}", stats);
}