bucket

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 1 Imported by: 0

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

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

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

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

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.

Jump to

Keyboard shortcuts

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