Documentation
¶
Overview ¶
Package to provides convenience conversion functions when working with histogram buckets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OrderedBuckets ¶
func OrderedBuckets(buckets MappedBuckets) []*prommodel.Bucket
OrderedBuckets returns the list of Prometheus protobuf buckets for the passed-in buckets map. The returned bucket list is sorted in ascending order by bucket inclusive upper limits.
Types ¶
type MappedBuckets ¶
MappedBuckets maps (inclusive) upper boundaries to their corresponding bucket sample counts.
func SampledBuckets ¶
func SampledBuckets(samples []float64, upperboundaries []float64) (buckets MappedBuckets, count uint64, sum float64)
SampledBuckets returns the (cumulative) buckets, count, and sum for the given lists of samples and bucket (inclusive) upper boundaries. The bucket boundaries list must not include “+Inf”. In the Prometheus histogram bucket model, the +Inf bucket is implicit in the sample sum and sample count.