11 unstable releases (5 breaking)

0.7.0 Aug 15, 2024
0.6.0 Apr 4, 2024
0.5.0 Mar 1, 2024
0.4.0 Jan 21, 2023
0.1.3 May 27, 2020

#209 in Machine learning

Download history 21/week @ 2024-08-30 10/week @ 2024-09-06 16/week @ 2024-09-13 22/week @ 2024-09-20 22/week @ 2024-09-27 18/week @ 2024-10-04 14/week @ 2024-10-11 7/week @ 2024-10-18 8/week @ 2024-10-25 20/week @ 2024-11-01 24/week @ 2024-11-08 37/week @ 2024-11-15 47/week @ 2024-11-22 23/week @ 2024-11-29 40/week @ 2024-12-06 7/week @ 2024-12-13

126 downloads per month

MIT license

50KB
1K SLoC

linux-taskstats-rs

Rust interface to Linux's taskstats.

This crate provides access to taskstats which is known as a way to access task's "delay" information a.k.a Delay Accounting.

Usage

use linux_taskstats::{self, Delays, Client};

fn get_thread_delays(pid: u32) -> Result<Delays, linux_taskstats::Error> {
    let client = Client::open()?;
    let ts = client.pid_stats(pid)?;
    Ok(ts.delays)
}

fn get_process_delays(pid: u32) -> Result<Delays, linux_taskstats::Error> {
    let client = Client::open()?;
    let ts = client.tgid_stats(pid)?;
    Ok(ts.delays)
}

How to build

cargo test
cargo build

Or on platform other than linux:

./docker-build/build-docker-image.sh # Just once, creates a image `taskstats-build:latest`
./docker-build/build.sh
# The outputs will be created under docker-build/target

License

MIT

Dependencies

~3–14MB
~170K SLoC