Crate tokio_eld

Source
Expand description

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().

§EldHistogram

EldHistogram supports recording and analyzing event loop delay using a High Dynamic Range (HDR) Histogram. The recorded delays are in nanoseconds.

Refer to documentation for hdrhistogram::Histogram for more information on how to use the core data structure.

§Usage

use tokio_eld::EldHistogram;

let mut h = EldHistogram::<u64>::new(20).unwrap();
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));

Structs§

  • A Histogram that can written to concurrently by mutiple tasks, used to measure event loop delays.

Enums§

  • Error types used in this crate.

Type Aliases§