sampling

package
v0.0.0-...-9c99d76 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 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 observation 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 NewPeriodicallyResetSampler

func NewPeriodicallyResetSampler(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