latency_trace

Crates.iolatency_trace
lib.rslatency_trace
version0.5.2
sourcesrc
created_at2024-07-08 21:50:52.02448
updated_at2024-07-11 12:37:06.818843
descriptionsupports latency measurement for functions and code blocks, both sync and async.
homepage
repositoryhttps://github.com/pvillela/rust-latency-trace/tree/main
max_upload_size
id1296449
size94,508
Paulo Villela (pvillela)

documentation

README

latency_trace

This library supports latency measurement for functions and code blocks, both sync and async. Given code instrumented with the Rust tracing library, this library uses histograms from the hdrhistogram library to capture span latency timings. Latencies are collected in microseconds for all spans with level trace or higher. See the documentation for details.

Documentation

See the API documentation on docs.rs, which includes a comprehensive overview and usage examples. The source repo also contains benchmarks and additional examples.

Support

Create a new issue on GitHub.

Related work

Crate tracing-timing also collects latency information for code instrumented with the tracing library, using histograms from hdrhistogram. tracing-timing collects latencies for events within spans. This provides more flexibility but also requires events to be defined within spans in order to measure latencies. Interpreting the latency results associated with events can be challenging for async code. By contrast, this framework simply measures span latencies and ignores events.

I am grateful to the author of tracing-timing for creating a high-quality, well-documented library which introduced me to the hdrhistogram crate and provided key insights into latency tracing concepts and mechanisms.

License

This library is distributed under the terms of the MIT license, with copyright retained by the author.

See LICENSE for details.

Commit count: 0

cargo fmt