circonusllhist

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package circllhist provides an implementation of Circonus' fixed log-linear histogram data structure. This allows tracking of histograms in a composable way such that accurate error can be reasoned about.

Index

Constants

View Source
const (
	BVL1, BVL1MASK uint64 = iota, 0xff << (8 * iota)
	BVL2, BVL2MASK
	BVL3, BVL3MASK
	BVL4, BVL4MASK
	BVL5, BVL5MASK
	BVL6, BVL6MASK
	BVL7, BVL7MASK
	BVL8, BVL8MASK
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Histogram

type Histogram struct {
	// contains filtered or unexported fields
}

This histogram structure tracks values are two decimal digits of precision with a bounded error that remains bounded upon composition

func Deserialize

func Deserialize(in io.Reader) (h *Histogram, err error)

func New

func New() *Histogram

New returns a new Histogram

func NewFromStrings

func NewFromStrings(strs []string, locks bool) (*Histogram, error)

NewFromStrings returns a Histogram created from DecStrings strings

func NewNoLocks

func NewNoLocks() *Histogram

New returns a Histogram without locking

func (*Histogram) ApproxMean

func (h *Histogram) ApproxMean() float64

Approximate mean

func (*Histogram) ApproxQuantile

func (h *Histogram) ApproxQuantile(q_in []float64) ([]float64, error)

func (*Histogram) ApproxSum

func (h *Histogram) ApproxSum() float64

Approximate sum

func (*Histogram) Copy

func (h *Histogram) Copy() *Histogram

Copy creates and returns an exact copy of a histogram.

func (*Histogram) CopyAndReset

func (h *Histogram) CopyAndReset() *Histogram

CopyAndReset creates and returns an exact copy of a histogram, and resets it to default empty values.

func (*Histogram) DecStrings

func (h *Histogram) DecStrings() []string

func (*Histogram) Equals

func (h *Histogram) Equals(other *Histogram) bool

Equals returns true if the two Histograms are equivalent, false if not.

func (*Histogram) FullReset

func (h *Histogram) FullReset()

FullReset resets a histogram to default empty values.

func (*Histogram) MarshalJSON

func (h *Histogram) MarshalJSON() ([]byte, error)

func (*Histogram) Max

func (h *Histogram) Max() float64

Max returns the approximate maximum recorded value.

func (*Histogram) Mean

func (h *Histogram) Mean() float64

Mean returns the approximate arithmetic mean of the recorded values.

func (*Histogram) Min

func (h *Histogram) Min() float64

Min returns the approximate minimum recorded value.

func (*Histogram) RecordCorrectedValue

func (h *Histogram) RecordCorrectedValue(v, expectedInterval int64) error

RecordCorrectedValue records the given value, correcting for stalls in the recording process. This only works for processes which are recording values at an expected interval (e.g., doing jitter analysis). Processes which are recording ad-hoc values (e.g., latency for incoming requests) can't take advantage of this. CH Compat

func (*Histogram) RecordDuration

func (h *Histogram) RecordDuration(v time.Duration) error

RecordDuration records the given time.Duration in seconds, returning an error if the value is out of range.

func (*Histogram) RecordIntScale

func (h *Histogram) RecordIntScale(val int64, scale int) error

RecordIntScale records an integer scaler value, returning an error if the value is out of range.

func (*Histogram) RecordIntScales

func (h *Histogram) RecordIntScales(val int64, scale int, n int64) error

RecordIntScales records n occurrences of the given value, returning an error if the value is out of range.

func (*Histogram) RecordValue

func (h *Histogram) RecordValue(v float64) error

RecordValue records the given value, returning an error if the value is out of range.

func (*Histogram) RecordValues

func (h *Histogram) RecordValues(v float64, n int64) error

RecordValues records n occurrences of the given value, returning an error if the value is out of range.

func (*Histogram) Reset

func (h *Histogram) Reset()

Reset forgets all bins in the histogram (they remain allocated)

func (*Histogram) Serialize

func (h *Histogram) Serialize(w io.Writer) error

func (*Histogram) SerializeB64

func (h *Histogram) SerializeB64(w io.Writer) error

func (*Histogram) SignificantFigures

func (h *Histogram) SignificantFigures() int64

SignificantFigures returns the significant figures used to create the histogram CH Compat

func (*Histogram) UnmarshalJSON

func (h *Histogram) UnmarshalJSON(b []byte) error

UnmarshalJSON - histogram will come in a base64 encoded serialized form

func (*Histogram) ValueAtQuantile

func (h *Histogram) ValueAtQuantile(q float64) float64

ValueAtQuantile returns the recorded value at the given quantile (0..1).

Jump to

Keyboard shortcuts

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