to

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

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

type MappedBuckets = map[float64]uint64

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL