pelikan-io / rustcommon

Common Rust library
Apache License 2.0
26 stars 13 forks source link

feat: change heatmap encoding #38

Closed brayniac closed 1 year ago

brayniac commented 1 year ago

Previously, the heatmap stored delta histograms plus a summary histogram. This gave us easy access to calculate percentiles across the configured time span, but required incrementing two histograms for every increment and subtracting histograms when aging out old histograms.

Another approach is to use free-running histograms and perform a subtraction only when percentiles are needed or when iterating through the heatmap. As these access methods are expected to be much less frequent than updates, it seems worthwhile to switch to this encoding to make updates less expensive.

Makes required changes to the histogram crate to support the operations needed within the heatmap.

brayniac commented 1 year ago

Abandoning in favor of #66