Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FrameToSeriesSlice ¶
func FrameToSeriesSlice(frame *data.Frame) (tsdb.TimeSeriesSlice, error)
FrameToSeriesSlice converts a frame that is a valid time series as per data.TimeSeriesSchema() to a TimeSeriesSlice.
func HumanThresholdType ¶
HumanThresholdType converts a threshold "type" string to a string that matches the UI so errors are less confusing.
Types ¶
type AlertEvaluator ¶
AlertEvaluator evaluates the reduced value of a timeseries. Returning true if a timeseries is violating the condition ex: ThresholdEvaluator, NoValueEvaluator, RangeEvaluator
func NewAlertEvaluator ¶
func NewAlertEvaluator(model *simplejson.Json) (AlertEvaluator, error)
NewAlertEvaluator is a factory function for returning an `AlertEvaluator` depending on the json model.
type AlertQuery ¶
type AlertQuery struct { Model *simplejson.Json DatasourceID int64 From string To string }
AlertQuery contains information about what datasource a query should be sent to and the query object.
type QueryCondition ¶
type QueryCondition struct { Index int Query AlertQuery Reducer *queryReducer Evaluator AlertEvaluator Operator string HandleRequest tsdb.HandleRequestFunc }
QueryCondition is responsible for issue and query, reduce the timeseries into single values and evaluate if they are firing or not.
func (*QueryCondition) Eval ¶
func (c *QueryCondition) Eval(context *alerting.EvalContext) (*alerting.ConditionResult, error)
Eval evaluates the `QueryCondition`.