Package bucket provides utility functions for constructing and merging histogram buckets. Buckets are meant to be used in the base metrics package's HistogramSpec struct.
Flatten concatenates multiple sets of buckets into a single slice. After flattening, it checks that the result is sorted and that no buckets are duplicated.
func NewExponential ¶
NewExponential creates n exponential buckets, starting with the supplied initial value and increasing by a user-defined factor each time.
If n is less than one, the initial value is less than one, or the factor is less than two, NewExponential returns a nil slice.
NewLinear creates n linear buckets, starting with the supplied initial value and increasing by a user-defined width.
If n or width are less than one, NewLinear returns a nil slice.