sampling

package
v0.0.0-...-d5f9cbc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2014 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sampling provides several sampling algorithms. These algorithms will be used to sample containers' stats information

Index

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

func NewAutoFilterSampler(sampler Sampler, filter func(d interface{}) bool) Sampler

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

func NewChainSampler(sampleSize, windowSize int) Sampler

Chain sampler described in Brian Babcok, Mayur Datar and Rajeev Motwani, Sampling From a Moving Window Over Streaming Data

func NewESSampler

func NewESSampler(size int, weight func(interface{}) float64) Sampler

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.

http://dl.acm.org/citation.cfm?id=1138834

func NewPeriodcallyResetSampler

func NewPeriodcallyResetSampler(period time.Duration, sampler Sampler) Sampler

func NewReservoirSampler

func NewReservoirSampler(reservoirSize int) Sampler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL