#latency #tracing #measurement #observability #performance

latency_trace

supports latency measurement for functions and code blocks, both sync and async

2 releases

0.5.2 Jul 11, 2024
0.5.1 Jul 8, 2024
0.5.0 Jul 8, 2024

#122 in Profiling

Download history 196/week @ 2024-07-04 136/week @ 2024-07-11 3/week @ 2024-07-18 13/week @ 2024-07-25

89 downloads per month

MIT license

61KB
1K SLoC

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.

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.

Dependencies

~2.3–9.5MB
~68K SLoC