#metrics #performance #tuning #lock-free #telemetry

marx

a high performance zero-config metric implementation

1 unstable release

0.0.3 Feb 9, 2021

#13 in #tuning

Apache-2.0

9KB
156 lines

historian

Build Status crates.io 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