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
- type Histogram
- func (h *Histogram) ApproxMean() float64
- func (h *Histogram) ApproxQuantile(q_in []float64) ([]float64, error)
- func (h *Histogram) ApproxSum() float64
- func (h *Histogram) Copy() *Histogram
- func (h *Histogram) CopyAndReset() *Histogram
- func (h *Histogram) DecStrings() []string
- func (h *Histogram) Equals(other *Histogram) bool
- func (h *Histogram) FullReset()
- func (h *Histogram) MarshalJSON() ([]byte, error)
- func (h *Histogram) Max() float64
- func (h *Histogram) Mean() float64
- func (h *Histogram) Min() float64
- func (h *Histogram) RecordCorrectedValue(v, expectedInterval int64) error
- func (h *Histogram) RecordDuration(v time.Duration) error
- func (h *Histogram) RecordIntScale(val int64, scale int) error
- func (h *Histogram) RecordIntScales(val int64, scale int, n int64) error
- func (h *Histogram) RecordValue(v float64) error
- func (h *Histogram) RecordValues(v float64, n int64) error
- func (h *Histogram) Reset()
- func (h *Histogram) Serialize(w io.Writer) error
- func (h *Histogram) SerializeB64(w io.Writer) error
- func (h *Histogram) SignificantFigures() int64
- func (h *Histogram) UnmarshalJSON(b []byte) error
- func (h *Histogram) ValueAtQuantile(q float64) float64
Constants ¶
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 NewFromStrings ¶
NewFromStrings returns a Histogram created from DecStrings strings
func (*Histogram) ApproxQuantile ¶
func (*Histogram) CopyAndReset ¶
CopyAndReset creates and returns an exact copy of a histogram, and resets it to default empty values.
func (*Histogram) DecStrings ¶
func (*Histogram) FullReset ¶
func (h *Histogram) FullReset()
FullReset resets a histogram to default empty values.
func (*Histogram) MarshalJSON ¶
func (*Histogram) RecordCorrectedValue ¶
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 ¶
RecordDuration records the given time.Duration in seconds, returning an error if the value is out of range.
func (*Histogram) RecordIntScale ¶
RecordIntScale records an integer scaler value, returning an error if the value is out of range.
func (*Histogram) RecordIntScales ¶
RecordIntScales records n occurrences of the given value, returning an error if the value is out of range.
func (*Histogram) RecordValue ¶
RecordValue records the given value, returning an error if the value is out of range.
func (*Histogram) RecordValues ¶
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) SignificantFigures ¶
SignificantFigures returns the significant figures used to create the histogram CH Compat
func (*Histogram) UnmarshalJSON ¶
UnmarshalJSON - histogram will come in a base64 encoded serialized form
func (*Histogram) ValueAtQuantile ¶
ValueAtQuantile returns the recorded value at the given quantile (0..1).