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) Merge(o *Histogram)
- 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 ¶
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) Copy ¶ added in v0.1.3
Copy creates and returns an exact copy of a histogram.
func (*Histogram) CopyAndReset ¶
CopyAndReset creates and returns an exact copy of a histogram, and resets it to default empty values.
func (*Histogram) Equals ¶
Equals returns true if the two Histograms are equivalent, false if not.
func (*Histogram) FullReset ¶ added in v0.1.3
func (h *Histogram) FullReset()
FullReset resets a histogram to default empty values.
func (*Histogram) Max ¶
Max returns the approximate maximum recorded value.
func (*Histogram) Mean ¶
Mean returns the approximate arithmetic mean of the recorded values.
func (*Histogram) Merge ¶ added in v0.1.4
Merge merges all bins from another histogram.
func (*Histogram) Min ¶
Min returns the approximate minimum recorded value.
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 ¶ added in v0.1.2
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