Documentation
¶
Overview ¶
Package stats implements performant statistics implementations.
Index ¶
- type Pool
- type Sample
- func (s *Sample) Add(v float64)
- func (s *Sample) Count() int64
- func (s *Sample) Max() float64
- func (s *Sample) Mean() float64
- func (s *Sample) Min() float64
- func (s *Sample) Percentiles(ns []float64) []float64
- func (s *Sample) Reset()
- func (s *Sample) StdDev() float64
- func (s *Sample) Sum() float64
- func (s *Sample) Variance() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of samples.
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
Sample calculates incremental statistics such as mean, variance, standard deviation and estimates percentiles.
The incremental stats are based on the algorithm described here: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance .
func (*Sample) Percentiles ¶
Percentiles returns the estimated percentiles of the sample.
The returned slice is backed by internal storage and is only valid until the next call to Percentiles or Reset on this Sample.
Click to show internal directories.
Click to hide internal directories.