query

package
v0.0.0-...-5da7e01 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EOF is End Of File.
	EOF = -1
)
View Source
const FALSE = 57349
View Source
const FUNC = 57351
View Source
const IDENTIFIER = 57350
View Source
const LBRACK = 57352
View Source
const NUMBER = 57346
View Source
const RBRACK = 57353
View Source
const STRING = 57347
View Source
const TRUE = 57348

Variables

This section is empty.

Functions

func EvalTarget

func EvalTarget(reader storage.ReadWriter, target string, startTime, endTime time.Time) (model.SeriesSlice, error)

EvalTarget evaluates the target. It parses the target into AST structure and fetches datapoints from storage.

ex. target: "alias(sumSeries(server1.loadavg5,server2.loadavg5),\"server_loadavg5\")"

func EvalTargets

func EvalTargets(reader storage.ReadWriter, targets []string, startTime, endTime time.Time) (model.SeriesSlice, error)

EvalTargets evaluates the targets concurrently. It is guaranteed that the order of the targets as input value and SeriesSlice as retuen value is the same.

Types

type ArgumentError

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

ArgumentError represents an error of the argument of query functions.

func (*ArgumentError) Error

func (e *ArgumentError) Error() string

Error returns the error message for ArgumentError.

type BoolExpr

type BoolExpr struct {
	Literal bool
}

BoolExpr provides Number expression.

func (BoolExpr) String

func (e BoolExpr) String() string

String returns string representation of the expression.

type Expr

type Expr interface {
	String() string
	// contains filtered or unexported methods
}

Expr represents each of query expression.

func ParseTarget

func ParseTarget(target string) (Expr, error)

ParseTarget parses target string into the AST structure.

type FuncExpr

type FuncExpr struct {
	Name     string
	SubExprs []Expr
}

FuncExpr provides function expression.

func (FuncExpr) String

func (e FuncExpr) String() string

String returns string representation of the expression.

type GroupSeriesExpr

type GroupSeriesExpr struct {
	Prefix    string
	ValueList []string
	Postfix   string
}

GroupSeriesExpr provides grouping series expression.

func (GroupSeriesExpr) String

func (e GroupSeriesExpr) String() string

String returns string representation of the expression.

type Lexer

type Lexer struct {
	scanner.Scanner
	// contains filtered or unexported fields
}

Lexer provides the argument of yyParse.

func (*Lexer) Error

func (l *Lexer) Error(msg string)

Error returns the error message of parser.

func (*Lexer) Lex

func (l *Lexer) Lex(lval *yySymType) int

Lex returns the token number for the yacc parser.

type NumberExpr

type NumberExpr struct {
	Literal float64
}

NumberExpr provides Number expression.

func (NumberExpr) String

func (e NumberExpr) String() string

String returns string representation of the expression.

type ParserError

type ParserError struct {
	Msg    string
	Column int
	Target string
}

ParserError represents the error of query parser.

func (*ParserError) Error

func (e *ParserError) Error() string

Error returns the error message for ParserError.

type SeriesListExpr

type SeriesListExpr struct {
	Literal string
}

SeriesListExpr provides SeriesList expression.

func (SeriesListExpr) String

func (e SeriesListExpr) String() string

String returns string representation.

type StringExpr

type StringExpr struct {
	Literal string
}

StringExpr provides String expression.

func (StringExpr) String

func (e StringExpr) String() string

String returns string representation of the expression.

type Token

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

Token represents the token of the query expression.

type UnsupportedFunctionError

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

UnsupportedFunctionError represents the error of unsupported query function.

func (*UnsupportedFunctionError) Error

func (e *UnsupportedFunctionError) Error() string

Error returns the error message for UnsupportedFunctionError. UnsupportedFunctionError satisfies error interface.

Jump to

Keyboard shortcuts

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