prometheus/model/histogram
Björn Rabenstein dccfb9db4e
histogram: Remove code replication via generics (#11361)
* histogram: Simplify iterators

We don't really need currLower and currUpper and can calculate it when
needed (as already done for the floatBucketIterator). The calculation
is cheap, while keeping those extra variables around costs RAM
(potentially a lot with many iterators).

* histogram: Convert Bucket/FloatBucket to one generic type

* histogram: Move some bucket iterator code into generic base iterator

* histogram: Remove cumulative iterator for FloatHistogram

We added it in the past for completeness (Histogram has one), but it
has never been used. Plus, even the cumulative iterator for Histogram
is only there for test reasons.

We can always add it back, and then maybe even using generics.

Signed-off-by: beorn7 <beorn@grafana.com>
2022-10-03 16:45:27 +05:30
..
float_histogram_test.go histogram: Remove code replication via generics (#11361) 2022-10-03 16:45:27 +05:30
float_histogram.go histogram: Remove code replication via generics (#11361) 2022-10-03 16:45:27 +05:30
generic.go histogram: Remove code replication via generics (#11361) 2022-10-03 16:45:27 +05:30
histogram_test.go histogram: Remove code replication via generics (#11361) 2022-10-03 16:45:27 +05:30
histogram.go histogram: Remove code replication via generics (#11361) 2022-10-03 16:45:27 +05:30