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

#298 in Data structures

Download history 188/week @ 2023-11-27 164/week @ 2023-12-04 91/week @ 2023-12-11 126/week @ 2023-12-18 143/week @ 2023-12-25 76/week @ 2024-01-01 194/week @ 2024-01-08 207/week @ 2024-01-15 78/week @ 2024-01-22 162/week @ 2024-01-29 238/week @ 2024-02-05 346/week @ 2024-02-12 315/week @ 2024-02-19 405/week @ 2024-02-26 451/week @ 2024-03-04 185/week @ 2024-03-11

1,383 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