Crates.io | latency_trace |
lib.rs | latency_trace |
version | 0.5.2 |
source | src |
created_at | 2024-07-08 21:50:52.02448 |
updated_at | 2024-07-11 12:37:06.818843 |
description | supports latency measurement for functions and code blocks, both sync and async. |
homepage | |
repository | https://github.com/pvillela/rust-latency-trace/tree/main |
max_upload_size | |
id | 1296449 |
size | 94,508 |
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.
See the API documentation on docs.rs, which includes a comprehensive overview and usage examples. The source repo also contains benchmarks and additional examples.
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.
This library is distributed under the terms of the MIT license, with copyright retained by the author.
See LICENSE for details.