Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Aggregator ¶
type Aggregator struct { Fun string `json:"fun"` In chan [][]byte `json:"-"` // incoming metrics, already split in 3 fields Regex string `json:"regex,omitempty"` OutFmt string Interval uint // expected interval between values in seconds, we will quantize to make sure alginment to interval-spaced timestamps Wait uint // seconds to wait after quantized time value before flushing final outcome and ignoring future values that are sent too late. // contains filtered or unexported fields }
func New ¶
func New(fun, regex, outFmt string, interval, wait uint, out chan []byte) (*Aggregator, error)
New creates an aggregator
func (*Aggregator) AddOrCreate ¶
func (a *Aggregator) AddOrCreate(key string, ts uint, value float64)
func (*Aggregator) Flush ¶
func (a *Aggregator) Flush(ts uint)
Flush finalizes and removes aggregations that are due
func (*Aggregator) PreMatch ¶
func (agg *Aggregator) PreMatch(buf []byte) bool
PreMatch checks if the specified metric might match the regex by comparing it to the prefix derived from the regex if this returns false, the metric will definitely not match the regex and be ignored.
func (*Aggregator) Shutdown ¶
func (agg *Aggregator) Shutdown()
func (*Aggregator) Snapshot ¶
func (agg *Aggregator) Snapshot() *Aggregator
to view the state of the aggregator at any point in time
Click to show internal directories.
Click to hide internal directories.