Documentation ¶
Overview ¶
Package sampling provides several sampling algorithms. These algorithms will be used to sample containers' stats information
Index ¶
- type Sampler
- func NewAutoFilterSampler(sampler Sampler, filter func(d interface{}) bool) Sampler
- func NewChainSampler(sampleSize, windowSize int) Sampler
- func NewESSampler(size int, weight func(interface{}) float64) Sampler
- func NewPeriodcallyResetSampler(period time.Duration, sampler Sampler) Sampler
- func NewReservoirSampler(reservoirSize int) Sampler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sampler ¶
type Sampler interface { Update(d interface{}) Len() int Reset() Map(f func(interface{})) // Filter() should update in place. Removing elements may or may not // affect the statistical behavior of the sampler, i.e. the probability // that an obervation will be sampled after removing some elements is // implementation defined. Filter(filter func(interface{}) bool) }
func NewAutoFilterSampler ¶
Add a decorator for sampler. Whenever an Update() is called, the sampler will call filter() first to remove elements in the decorated sampler.
func NewChainSampler ¶
Chain sampler described in Brian Babcok, Mayur Datar and Rajeev Motwani, Sampling From a Moving Window Over Streaming Data
func NewESSampler ¶
ES sampling algorithm described in
Pavlos S. Efraimidis and Paul G. Spirakis. Weighted random sampling with a reservoir. Information Processing Letters, 97(5):181 – 185, 2006.
func NewReservoirSampler ¶
Click to show internal directories.
Click to hide internal directories.