Expand description
Arithmetic on owned native histograms, following Prometheus FloatHistogram
(model/histogram/float_histogram.go): Add, KahanAdd, Sub, Mul, Div, Compact,
CopyToSchema, DetectReset and Equals, including zero bucket reconciliation, resolution
reduction and the intersection of mismatched custom bounds.
Each side is a list of (bucket index, count) sorted by index. Go splices span layouts in
place; the bucket indices and the order of additions to each bucket do not depend on the
layout, so the results are the same.
Structsยง
- AddOutcome ๐
- What an addition or subtraction reports besides its result.
- Float
Histogram ๐ - A native histogram with absolute bucket counts.
- RollUp ๐
- The rolling sum of custom buckets up to a bound, as Goโs
rollupSumForBoundclosure keeps it across calls.
Functionsยง
- add_
buckets ๐ - Go
addBucketsandkahanAddBuckets: addssign * otherto one side ofh, inserting the bucketshlacks. Leading buckets ofotherinside the zero bucket are skipped. - add_
custom_ ๐buckets_ with_ mismatches - Go
addCustomBucketsWithMismatches: maps both sides onto the intersected bounds, adding with Kahan summation, and drops buckets left empty. Returns the buckets and their compensation. - canonical_
spans ๐ - Spans with one span per run of consecutive indices.
- check_
schemas ๐ - compact_
with ๐ - Go
kahanCompact(0): drops the buckets whose count and compensation are both zero. - incompatible_
schema ๐ - intersect_
custom_ ๐bounds - Go
intersectCustomBucketBounds. - iterate ๐
- Go
floatBucketIterator: the buckets ofsidemerged down totarget, without the leading ones whose upper bound is at mostthreshold. - kahan_
reduce_ ๐resolution - Go
kahanReduceResolution. - reduce_
resolution ๐ - Go
reduceResolutionwithout delta encoding. - side_
from_ ๐view - side_
reset ๐ - Go
detectResetover two sides with matching indices. - spans_
match ๐ - Go
spansMatch: equal layouts once zero-length spans are folded into the next span. - target_
index ๐ - Go
targetIdx. - zero_
compensation ๐
Type Aliasesยง
- Buckets ๐