Documentation ¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flatten ¶
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.
func NewLinear ¶
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.
func NewRPCLatency ¶
func NewRPCLatency() []int64
NewRPCLatency returns a hand-crafted set of buckets useful for tracking the latency of RPCs (in milliseconds). Buckets range from 1 to 10000 (i.e., 1ms-10s), getting less granular as latency increases.
Types ¶
This section is empty.