expr

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-2-Clause Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrZipperNotInit = errors.New("zipper not initialized")

Functions

func AlphabeticallyByPart

func AlphabeticallyByPart(metrics []*types.MetricData, part int) sort.Interface

AlphabeticallyByPart returns a byPartAlphabetical that will sort 'metrics' alphabetically by 'part'.

func EvalExpr

func EvalExpr(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)

EvalExpr is the main expression evaluator.

func FetchAndEvalExp added in v0.13.0

func FetchAndEvalExp(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, merry.Error)

FetchAndEvalExp fetch data and evaluates expressions

func FetchAndEvalExprs added in v0.16.0

func FetchAndEvalExprs(ctx context.Context, eval interfaces.Evaluator, exprs []parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, map[string]merry.Error)

func RewriteExpr

func RewriteExpr(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (bool, []string, error)

RewriteExpr expands targets that use applyByNode into a new list of targets. eg: applyByNode(foo*, 1, "%") -> (true, ["foo1", "foo2"], nil) sumSeries(foo) -> (false, nil, nil) Assumes that applyByNode only appears as the outermost function.

func SortMetrics

func SortMetrics(metrics []*types.MetricData, mfetch parser.MetricRequest)

SortMetrics sort metric data alphabetically.

Types

type Evaluator added in v0.17.0

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

func NewEvaluator added in v0.17.0

func NewEvaluator(limiter limiter.SimpleLimiter, zipper zipper.CarbonZipper, passFunctionsToBackend bool) (*Evaluator, error)

NewEvaluator create evaluator with limiter and zipper

func (Evaluator) Eval added in v0.17.0

func (eval Evaluator) Eval(ctx context.Context, exp parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (results []*types.MetricData, err error)

Eval evaluates expressions.

func (Evaluator) Fetch added in v0.17.0

func (eval Evaluator) Fetch(ctx context.Context, exprs []parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (map[parser.MetricRequest][]*types.MetricData, error)

Directories

Path Synopsis
exp
fft
pow
slo

Jump to

Keyboard shortcuts

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