native

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFetchExpressions

func ExtractFetchExpressions(s string) ([]string, error)

ExtractFetchExpressions extracts timeseries fetch expressions from the given query

func MustRegisterAliasedFunction

func MustRegisterAliasedFunction(fname string, f interface{})

MustRegisterAliasedFunction registers a function under an alias, issuing a panic if the function cannot be registered

Types

type ArgumentASTNode

type ArgumentASTNode interface {
	String() string
}

ArgumentASTNode is an interface to help with printing the AST.

type CallASTNode

type CallASTNode interface {
	// Name returns the name of the call.
	Name() string
	// Arguments describe each argument that the call has, some
	// arguments can be casted to an Call themselves.
	Arguments() []ArgumentASTNode
}

CallASTNode is an interface to help with printing the AST.

type Engine

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

The Engine for running queries.

func NewEngine

func NewEngine(store storage.Storage) *Engine

NewEngine creates a new query engine.

func (*Engine) Compile

func (e *Engine) Compile(s string) (Expression, error)

Compile compiles an expression from an expression string

func (*Engine) FetchByQuery

func (e *Engine) FetchByQuery(
	ctx context.Context,
	query string,
	start, end time.Time,
	timeout time.Duration,
) (*storage.FetchResult, error)

FetchByQuery retrieves one or more time series based on a query.

type Expression

type Expression interface {
	CallASTNode
	// Executes the expression against the given context, and returns the resulting time series data
	Execute(ctx *common.Context) (ts.SeriesList, error)
}

An Expression is a metric query expression

type Function

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

Function contains a function to invoke along with metadata about the function's argument and return type.

func MustRegisterFunction

func MustRegisterFunction(f interface{}) *Function

MustRegisterFunction registers a function, issuing a panic if the function cannot be registered

func (*Function) WithDefaultParams

func (f *Function) WithDefaultParams(defaultParams map[uint8]interface{}) *Function

WithDefaultParams provides default parameters for functions

Jump to

Keyboard shortcuts

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