window

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: BSD-3-Clause Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSampleFunc

type AddSampleFunc func(current, new interface{}) interface{}

type AggregateBlocksFunc

type AggregateBlocksFunc func(block []interface{}, size int) interface{}

type AggregateSingleFunc

type AggregateSingleFunc func(value interface{}, count int) interface{}

type SlidingTimeWindow

type SlidingTimeWindow struct {
	// contains filtered or unexported fields
}

SlidingTimeWindow - A sliding window based on time. Relies on external entity moving window along by calling NextBlock at the appropriate time. note: using interface{} 4x slower than using specific types, starting with interface{} for expediency

func (*SlidingTimeWindow) AddSample

func (w *SlidingTimeWindow) AddSample(sample interface{}) (bool, interface{})

func (*SlidingTimeWindow) NextBlock

func (w *SlidingTimeWindow) NextBlock() (bool, interface{})

type SlidingWindow

type SlidingWindow struct {
	// contains filtered or unexported fields
}

note: using interface{} 4x slower than using specific types, starting with interface{} for expediency todo split external vs on-add timer

func (*SlidingWindow) AddSample

func (w *SlidingWindow) AddSample(sample interface{}) (bool, interface{})

type TimeWindow

type TimeWindow interface {
	Window
	NextBlock() (bool, interface{})
}

func NewSlidingTimeWindow

func NewSlidingTimeWindow(addFunc AddSampleFunc, aggFunc AggregateBlocksFunc, windowTime int, resolution int, externalTimer bool) TimeWindow

func NewTumblingTimeWindow

func NewTumblingTimeWindow(addFunc AddSampleFunc, aggFunc AggregateSingleFunc, windowTime int, externalTimer bool) TimeWindow

type TumblingTimeWindow

type TumblingTimeWindow struct {
	// contains filtered or unexported fields
}

TumblingTimeWindow - A tumbling window based on time. Relies on external entity moving window along by calling NextBlock at the appropriate time. note: using interface{} 4x slower than using specific types, starting with interface{} for expediency

func (*TumblingTimeWindow) AddSample

func (w *TumblingTimeWindow) AddSample(sample interface{}) (bool, interface{})

func (*TumblingTimeWindow) NextBlock

func (w *TumblingTimeWindow) NextBlock() (bool, interface{})

type TumblingWindow

type TumblingWindow struct {
	// contains filtered or unexported fields
}

note: using interface{} 4x slower than using specific types, starting with interface{} for expediency

func (*TumblingWindow) AddSample

func (w *TumblingWindow) AddSample(sample interface{}) (bool, interface{})

type Window

type Window interface {
	AddSample(sample interface{}) (bool, interface{})
}

func NewSlidingWindow

func NewSlidingWindow(aggFunc AggregateBlocksFunc, windowSize int, resolution int) Window

func NewTumblingWindow

func NewTumblingWindow(addFunc AddSampleFunc, aggFunc AggregateSingleFunc, windowSize int) Window

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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