metrics: go.uber.org/net/metrics/bucket Index | Files

package bucket

import "go.uber.org/net/metrics/bucket"

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

Package Files

bucket.go

func Flatten Uses

func Flatten(buckets ...[]int64) ([]int64, error)

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 Uses

func NewExponential(initial, factor int64, n int) []int64

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 Uses

func NewLinear(initial, width int64, n int) []int64

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 Uses

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.

Package bucket imports 1 packages (graph) and is imported by 2 packages. Updated 2017-12-12. Refresh now. Tools for package owners.