classic

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassicConditionJSON

type ClassicConditionJSON struct {
	Evaluator ConditionEvalJSON `json:"evaluator"`

	Operator struct {
		Type string `json:"type"`
	} `json:"operator"`

	Query struct {
		Params []string `json:"params"`
	} `json:"query"`

	Reducer struct {
		// Params []interface{} `json:"params"` (Unused)
		Type string `json:"type"`
	} `json:"reducer"`
}

ClassicConditionJSON is the JSON model for a single condition. It is based on services/alerting/conditions/query.go's newQueryCondition().

type ConditionEvalJSON

type ConditionEvalJSON struct {
	Params []float64 `json:"params"`
	Type   string    `json:"type"` // e.g. "gt"
}

type ConditionsCmd

type ConditionsCmd struct {
	Conditions []condition
	// contains filtered or unexported fields
}

ConditionsCmd is command for the classic conditions expression operation.

func UnmarshalConditionsCmd

func UnmarshalConditionsCmd(rawQuery map[string]interface{}, refID string) (*ConditionsCmd, error)

UnmarshalConditionsCmd creates a new ConditionsCmd.

func (*ConditionsCmd) Execute

func (ccc *ConditionsCmd) Execute(ctx context.Context, vars mathexp.Vars) (mathexp.Results, error)

Execute runs the command and returns the results or an error if the command failed to execute.

func (*ConditionsCmd) NeedsVars

func (ccc *ConditionsCmd) NeedsVars() []string

NeedsVars returns the variable names (refIds) that are dependencies to execute the command and allows the command to fulfill the Command interface.

type EvalMatch

type EvalMatch struct {
	Value  *float64    `json:"value"`
	Metric string      `json:"metric"`
	Labels data.Labels `json:"labels"`
}

EvalMatch represents the series violating the threshold. It goes into the metadata of data frames so it can be extracted.

func (EvalMatch) MarshalJSON

func (em EvalMatch) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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