Documentation ¶
Index ¶
- Variables
- func AlphabeticallyByPart(metrics []*types.MetricData, part int) sort.Interface
- func EvalExpr(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, ...) ([]*types.MetricData, error)
- func FetchAndEvalExp(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, ...) ([]*types.MetricData, merry.Error)
- func FetchAndEvalExprs(ctx context.Context, eval interfaces.Evaluator, exprs []parser.Expr, ...) ([]*types.MetricData, map[string]merry.Error)
- func RewriteExpr(ctx context.Context, eval interfaces.Evaluator, e parser.Expr, ...) (bool, []string, error)
- func SortMetrics(metrics []*types.MetricData, mfetch parser.MetricRequest)
- type Evaluator
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)
Click to show internal directories.
Click to hide internal directories.