Help us shape the future of Go! Take the 2026 Go Developer Survey

window

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: BSD-3-Clause Imports: 6 Imported by: 2

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{}, start int, size int) interface{}

type AggregateSingleFunc

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

type BlockInfo

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

type BlockMapData

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

type DataInfo

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

type MapData

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

type Settings

type Settings struct {
	Size          int
	Resolution    int
	ExternalTimer bool

	TotalCountModifier int

	NameKey  string
	ValueKey string
}

func (*Settings) SetAdditionalSettings

func (s *Settings) SetAdditionalSettings(as map[string]string) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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