Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Percentile ¶
type Percentile struct {
// contains filtered or unexported fields
}
Percentile implements an efficient percentile calculation of arbitrary float64 samples.
func NewPercentile ¶
func NewPercentile(percentile float64) *Percentile
NewPercentile returns a Percentile with a given threshold.
func NewPercentileWithWindow ¶
func NewPercentileWithWindow(percentile float64, sampleWindow int) *Percentile
NewPercentileWithWindow returns a Percentile with a given threshold and window size (accuracy).
func (*Percentile) AddSample ¶
func (p *Percentile) AddSample(sample float64)
AddSample adds a single float64 sample to the data set. It is not thread-safe, and must not be called in parallel.
func (*Percentile) MarshalJSON ¶
func (p *Percentile) MarshalJSON() ([]byte, error)
func (*Percentile) Value ¶
func (p *Percentile) Value() float64
Value returns the current value at the stored percentile. It is thread-safe, and may be called concurrently with AddSample.
Click to show internal directories.
Click to hide internal directories.