Crates.io | linux-taskstats |
lib.rs | linux-taskstats |
version | 0.7.0 |
source | src |
created_at | 2020-05-25 14:40:13.009283 |
updated_at | 2024-08-15 10:01:48.451174 |
description | Rust interface to Linux taskstats |
homepage | |
repository | https://github.com/kawamuray/linux-taskstats-rs |
max_upload_size | |
id | 245607 |
size | 71,415 |
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.
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)
}
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