interfaces

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator interface {
	// Fetch populates the values map being passed into it by translating input expressions into a series of
	// parser.MetricRequest and fetching the raw data from the configured backend.
	//
	// It returns a map of only the data requested in the current invocation, scaled to a common step.
	Fetch(ctx context.Context, e []parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (map[parser.MetricRequest][]*types.MetricData, error)
	// Eval uses the raw data within the values map being passed into it to in order to evaluate the input expression.
	Eval(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)
}

Evaluator is an interface for any existing expression parser.

type Function

type Function interface {
	Do(ctx context.Context, evaluator Evaluator, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error)
	Description() map[string]types.FunctionDescription
}

Function is interface that all graphite functions should follow

type FunctionMetadata

type FunctionMetadata struct {
	Name     string
	Filename string
	Order    Order
	F        Function
}

type Order

type Order int
const (
	Any Order = iota
	Last
)

type RewriteFunction

type RewriteFunction interface {
	Do(ctx context.Context, evaluator Evaluator, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) (bool, []string, error)
	Description() map[string]types.FunctionDescription
}

RewriteFunction is interface that graphite functions that rewrite expressions should follow

type RewriteFunctionMetadata

type RewriteFunctionMetadata struct {
	Name     string
	Filename string
	Order    Order
	F        RewriteFunction
}

Jump to

Keyboard shortcuts

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