19 stable releases (3 major)

4.0.4 May 19, 2021
4.0.3 Mar 16, 2019
3.0.11 Jan 5, 2019
3.0.4 Sep 5, 2017
1.0.1 Aug 30, 2017

#492 in Data structures

Download history 183/week @ 2024-07-22 149/week @ 2024-07-29 146/week @ 2024-08-05 237/week @ 2024-08-12 138/week @ 2024-08-19 178/week @ 2024-08-26 151/week @ 2024-09-02 137/week @ 2024-09-09 102/week @ 2024-09-16 210/week @ 2024-09-23 138/week @ 2024-09-30 57/week @ 2024-10-07 297/week @ 2024-10-14 573/week @ 2024-10-21 466/week @ 2024-10-28 429/week @ 2024-11-04

1,770 downloads per month
Used in 22 crates (6 directly)

Apache-2.0

11KB
180 lines

historian

Build Status documentation

A zero-config simple histogram collector. ~160ns/collection with a random input, ~65ns/collection on already existing metrics. Uses logarithmic bucketing rather than sampling have bounded (generally <0.5%) error percentiles.


lib.rs:

A zero-config simple histogram collector for use in instrumented optimization. Uses logarithmic bucketing rather than sampling, and has bounded (generally <0.5%) error on percentiles. Performs no allocations after initial creation. Uses Relaxed atomics during collection.

When you create it, it allocates 65k AtomicUsize's that it uses for incrementing. Generating reports after running workloads on dozens of Histo's does not result in a perceptible delay, but it might not be acceptable for use in low-latency reporting paths.

The trade-offs taken in this are to minimize latency during collection, while initial allocation and postprocessing delays are acceptable.

Future work to further reduce collection latency may include using thread-local caches that perform no atomic operations until they are dropped, when they may atomically aggregate their measurements into the shared collector that will be used for reporting.

No runtime deps

Features