mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
ScyllaDB uses estimated_histogram in many places. We already have a more efficient alternative: estimated_histogram_with_max. It is both CPU- and memory-efficient, and it can be exported as Prometheus native histograms. Its main limitation (which also has benefits) is that the bucket layout is fixed at compile time, so histograms with different configurations cannot be mixed. The end goal is to replace all uses of estimated_histogram in the codebase. That migration requires a few small API adjustments, so it is done in steps. This PR replaces estimated_histogram for CAS contention. The PR includes a patch that adds functionality to the base approx_exponential_histogram, which will be used by the API. The specific histograms are defined in a single place and cover the range 1-100; this makes future changes easy. **New feature, no need to backport** Closes scylladb/scylladb#29017 * github.com:scylladb/scylladb: storage_proxy: migrate CAS contention histograms to estimated_histogram_with_max estimated_histogram.hh: Add bucket offset and count to approx_exponential_histogram
22 KiB
22 KiB