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 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{})
AddSample implements window.Window.AddSample
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{})
AddSample implements window.Window.AddSample
type TimeWindow ¶
type TimeWindow interface { Window // NextBlock tells the time window to advance NextBlock() (bool, interface{}) }
TimeWindow a time based sample window
func NewSlidingTimeWindow ¶
func NewSlidingTimeWindow(addFunc AddSampleFunc, aggFunc AggregateBlocksFunc, settings *Settings) TimeWindow
func NewTumblingTimeWindow ¶
func NewTumblingTimeWindow(addFunc AddSampleFunc, aggFunc AggregateSingleFunc, settings *Settings) 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{})
AddSample implements window.Window.AddSample
type Window ¶
type Window interface { // AddSample adds a sample to the window AddSample(sample interface{}) (bool, interface{}) }
Window is a basic sample window
func NewSlidingWindow ¶
func NewSlidingWindow(aggFunc AggregateBlocksFunc, settings *Settings) Window
func NewTumblingWindow ¶
func NewTumblingWindow(addFunc AddSampleFunc, aggFunc AggregateSingleFunc, settings *Settings) Window