conditions

package
v5.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertEvaluator

type AlertEvaluator interface {
	Eval(reducedValue null.Float) bool
}

func NewAlertEvaluator

func NewAlertEvaluator(model *simplejson.Json) (AlertEvaluator, error)

type AlertQuery

type AlertQuery struct {
	Model        *simplejson.Json
	DatasourceId int64
	From         string
	To           string
}

type NoValueEvaluator

type NoValueEvaluator struct{}

func (*NoValueEvaluator) Eval

func (e *NoValueEvaluator) Eval(reducedValue null.Float) bool

type QueryCondition

type QueryCondition struct {
	Index         int
	Query         AlertQuery
	Reducer       QueryReducer
	Evaluator     AlertEvaluator
	Operator      string
	HandleRequest tsdb.HandleRequestFunc
}

func NewQueryCondition

func NewQueryCondition(model *simplejson.Json, index int) (*QueryCondition, error)

func (*QueryCondition) Eval

type QueryReducer

type QueryReducer interface {
	Reduce(timeSeries *tsdb.TimeSeries) null.Float
}

type RangedEvaluator

type RangedEvaluator struct {
	Type  string
	Lower float64
	Upper float64
}

func (*RangedEvaluator) Eval

func (e *RangedEvaluator) Eval(reducedValue null.Float) bool

type SimpleReducer

type SimpleReducer struct {
	Type string
}

func NewSimpleReducer

func NewSimpleReducer(typ string) *SimpleReducer

func (*SimpleReducer) Reduce

func (s *SimpleReducer) Reduce(series *tsdb.TimeSeries) null.Float

type ThresholdEvaluator

type ThresholdEvaluator struct {
	Type      string
	Threshold float64
}

func (*ThresholdEvaluator) Eval

func (e *ThresholdEvaluator) Eval(reducedValue null.Float) bool

Jump to

Keyboard shortcuts

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