Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( NoOptimizers = []Optimizer{} AllOptimizers = append(DefaultOptimizers, PropagateMatchersOptimizer{}) )
var DefaultOptimizers = []Optimizer{ SortMatchers{}, MergeSelectsOptimizer{}, }
Functions ¶
This section is empty.
Types ¶
type Deduplicate ¶
type Deduplicate struct {
Expressions RemoteExecutions
}
Deduplicate is a logical plan which deduplicates samples from multiple RemoteExecutions.
func (Deduplicate) PositionRange ¶
func (r Deduplicate) PositionRange() parser.PositionRange
func (Deduplicate) Pretty ¶
func (r Deduplicate) Pretty(level int) string
func (Deduplicate) PromQLExpr ¶
func (r Deduplicate) PromQLExpr()
func (Deduplicate) String ¶
func (r Deduplicate) String() string
func (Deduplicate) Type ¶
func (r Deduplicate) Type() parser.ValueType
type DistributedExecutionOptimizer ¶
type DistributedExecutionOptimizer struct {
Endpoints api.RemoteEndpoints
}
DistributedExecutionOptimizer produces a logical plan suitable for distributed Query execution.
type FilteredSelector ¶
type FilteredSelector struct { *parser.VectorSelector Filters []*labels.Matcher }
func (FilteredSelector) PositionRange ¶
func (f FilteredSelector) PositionRange() parser.PositionRange
func (FilteredSelector) Pretty ¶
func (f FilteredSelector) Pretty(level int) string
func (FilteredSelector) PromQLExpr ¶
func (f FilteredSelector) PromQLExpr()
func (FilteredSelector) String ¶
func (f FilteredSelector) String() string
func (FilteredSelector) Type ¶
func (f FilteredSelector) Type() parser.ValueType
type MergeSelectsOptimizer ¶
type MergeSelectsOptimizer struct{}
MergeSelectsOptimizer optimizes a binary expression where one select is a superset of the other select. For example, the expression:
metric{a="b", c="d"} / scalar(metric{a="b"}) becomes: Filter(c="d", metric{a="b"}) / scalar(metric{a="b"}).
The engine can then cache the result of `metric{a="b"}` and apply an additional filter for {c="d"}.
type Noop ¶
type Noop struct{}
func (Noop) PositionRange ¶
func (r Noop) PositionRange() parser.PositionRange
func (Noop) PromQLExpr ¶
func (r Noop) PromQLExpr()
type Opts ¶
func (Opts) IsInstantQuery ¶
type PropagateMatchersOptimizer ¶
type PropagateMatchersOptimizer struct{}
PropagateMatchersOptimizer implements matcher propagation between two vector selectors in a binary expression.
type RemoteExecution ¶
type RemoteExecution struct { Engine api.RemoteEngine Query string QueryRangeStart time.Time }
RemoteExecution is a logical plan that describes a remote execution of a Query against the given PromQL Engine.
func (RemoteExecution) PositionRange ¶
func (r RemoteExecution) PositionRange() parser.PositionRange
func (RemoteExecution) Pretty ¶
func (r RemoteExecution) Pretty(level int) string
func (RemoteExecution) PromQLExpr ¶
func (r RemoteExecution) PromQLExpr()
func (RemoteExecution) String ¶
func (r RemoteExecution) String() string
func (RemoteExecution) Type ¶
func (r RemoteExecution) Type() parser.ValueType
type RemoteExecutions ¶
type RemoteExecutions []RemoteExecution
func (RemoteExecutions) String ¶
func (rs RemoteExecutions) String() string
type SortMatchers ¶
type SortMatchers struct{}
SortMatchers sorts all matchers in a selector so that all subsequent optimizers, both in the logical and physical plan, can rely on this property.
type TrimSortFunctions ¶
type TrimSortFunctions struct { }
TrimSortFunctions trims sort functions. It can do that because for nested sort functions we can safely say f(sort(X)) == f(X). Top-level sort functions are handled by the engine when presenting the query results. The engine depends on this optimizer to be able to ignore the 'sort' and 'sort_desc' functions when building its Operator tree.