#delays #testing #eld-histogram

tokio-eld

Histogram-based sampler for recording and analyzing event loop delays

2 unstable releases

0.2.0 Nov 17, 2024
0.1.0 Nov 16, 2024

#140 in Profiling

Download history 1744/week @ 2024-12-11 1783/week @ 2024-12-18 1368/week @ 2024-12-25 1265/week @ 2025-01-01 1602/week @ 2025-01-08 1849/week @ 2025-01-15 1850/week @ 2025-01-22 1757/week @ 2025-01-29 1582/week @ 2025-02-05 1535/week @ 2025-02-12 2339/week @ 2025-02-19 2256/week @ 2025-02-26 2116/week @ 2025-03-05 2044/week @ 2025-03-12 2181/week @ 2025-03-19 1665/week @ 2025-03-26

8,308 downloads per month
Used in 14 crates (via deno_node)

MIT/Apache

7KB
82 lines

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));

Dependencies

~2.5–8.5MB
~56K SLoC