Documentation ¶
Index ¶
- Constants
- func EvalTarget(reader storage.ReadWriter, target string, startTime, endTime time.Time) (model.SeriesSlice, error)
- func EvalTargets(reader storage.ReadWriter, targets []string, startTime, endTime time.Time) (model.SeriesSlice, error)
- type ArgumentError
- type BoolExpr
- type Expr
- type FuncExpr
- type GroupSeriesExpr
- type Lexer
- type NumberExpr
- type ParserError
- type SeriesListExpr
- type StringExpr
- type Token
- type UnsupportedFunctionError
Constants ¶
const (
// EOF is End Of File.
EOF = -1
)
const FALSE = 57349
const FUNC = 57351
const IDENTIFIER = 57350
const LBRACK = 57352
const NUMBER = 57346
const RBRACK = 57353
const STRING = 57347
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 Expr ¶
type Expr interface { String() string // contains filtered or unexported methods }
Expr represents each of query expression.
func ParseTarget ¶
ParseTarget parses target string into the AST structure.
type GroupSeriesExpr ¶
GroupSeriesExpr provides grouping series expression.
func (GroupSeriesExpr) String ¶
func (e GroupSeriesExpr) String() string
String returns string representation of the expression.
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 ¶
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.