tokio-eld

Crates.iotokio-eld
lib.rstokio-eld
version0.2.0
sourcesrc
created_at2024-11-16 06:21:08.463076
updated_at2024-11-17 16:01:11.290107
descriptionHistogram-based sampler for recording and analyzing event loop delays
homepage
repository
max_upload_size
id1450147
size6,712
Divy Srivastava (littledivy)

documentation

README

Crates.io

Documentation

tokio_eld provides a histogram-based sampler for recording and analyzing event loop delays in a current_thread Tokio runtime. The API is similar to Node.js's perf_hooks.monitorEventLoopDelay().

use tokio_eld::EldHistogram;

let mut histogram = EldHistogram::<u64>::new(20)?; // 20 ms resolution

h.start();
// do some work
h.stop();

println!("min: {}", h.min());
println!("max: {}", h.max());
println!("mean: {}", h.mean());
println!("stddev: {}", h.stdev());
println!("p50: {}", h.value_at_percentile(50.0));
println!("p90: {}", h.value_at_percentile(90.0));
Commit count: 0

cargo fmt