Documentation ¶
Index ¶
- Variables
- func NewEngine(opts EngineOpts, limitsProvider QueryLimitsProvider, ...) (promql.QueryEngine, error)
- func RegisterInstantVectorFunctionOperatorFactory(functionName string, factory InstantVectorFunctionOperatorFactory) error
- func RegisterScalarFunctionOperatorFactory(functionName string, factory ScalarFunctionOperatorFactory) error
- func TestMain(m *testing.M)
- type Engine
- type EngineOpts
- type FeatureToggles
- type InstantVectorFunctionOperatorFactory
- func ClampFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
- func ClampMinMaxFunctionOperatorFactory(functionName string, isMin bool) InstantVectorFunctionOperatorFactory
- func FunctionOverRangeVectorOperatorFactory(name string, f functions.FunctionOverRangeVectorDefinition) InstantVectorFunctionOperatorFactory
- func InstantVectorLabelManipulationFunctionOperatorFactory(name string, metadataFunc functions.SeriesMetadataFunctionDefinition) InstantVectorFunctionOperatorFactory
- func InstantVectorTransformationFunctionOperatorFactory(name string, seriesDataFunc functions.InstantVectorSeriesFunction) InstantVectorFunctionOperatorFactory
- func LabelReplaceFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
- func RoundFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
- func SingleInputVectorFunctionOperatorFactory(name string, f functions.FunctionOverInstantVectorDefinition) InstantVectorFunctionOperatorFactory
- type Query
- type QueryLimitsProvider
- type ScalarFunctionOperatorFactory
Constants ¶
This section is empty.
Variables ¶
var EnableAllFeatures = FeatureToggles{ true, true, true, true, true, true, true, }
EnableAllFeatures enables all features supported by MQE, including experimental or incomplete features.
Functions ¶
func NewEngine ¶
func NewEngine(opts EngineOpts, limitsProvider QueryLimitsProvider, metrics *stats.QueryMetrics, logger log.Logger) (promql.QueryEngine, error)
func RegisterInstantVectorFunctionOperatorFactory ¶
func RegisterInstantVectorFunctionOperatorFactory(functionName string, factory InstantVectorFunctionOperatorFactory) error
func RegisterScalarFunctionOperatorFactory ¶
func RegisterScalarFunctionOperatorFactory(functionName string, factory ScalarFunctionOperatorFactory) error
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) NewInstantQuery ¶
type EngineOpts ¶
type EngineOpts struct { CommonOpts promql.EngineOpts FeatureToggles FeatureToggles // When operating in pedantic mode, we panic if memory consumption is > 0 after Query.Close() // (indicating something was not returned to a pool). Pedantic bool }
func NewTestEngineOpts ¶
func NewTestEngineOpts() EngineOpts
type FeatureToggles ¶
type FeatureToggles struct { EnableAggregationOperations bool `yaml:"enable_aggregation_operations" category:"experimental"` EnableVectorVectorBinaryComparisonOperations bool `yaml:"enable_vector_vector_binary_comparison_operations" category:"experimental"` EnableVectorScalarBinaryComparisonOperations bool `yaml:"enable_vector_scalar_binary_comparison_operations" category:"experimental"` EnableScalarScalarBinaryComparisonOperations bool `yaml:"enable_scalar_scalar_binary_comparison_operations" category:"experimental"` EnableBinaryLogicalOperations bool `yaml:"enable_binary_logical_operations" category:"experimental"` EnableScalars bool `yaml:"enable_scalars" category:"experimental"` EnableSubqueries bool `yaml:"enable_subqueries" category:"experimental"` }
func (*FeatureToggles) RegisterFlags ¶
func (t *FeatureToggles) RegisterFlags(f *flag.FlagSet)
type InstantVectorFunctionOperatorFactory ¶
type InstantVectorFunctionOperatorFactory func( args []types.Operator, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, annotations *annotations.Annotations, expressionPosition posrange.PositionRange, timeRange types.QueryTimeRange, ) (types.InstantVectorOperator, error)
func ClampFunctionOperatorFactory ¶
func ClampFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
func ClampMinMaxFunctionOperatorFactory ¶
func ClampMinMaxFunctionOperatorFactory(functionName string, isMin bool) InstantVectorFunctionOperatorFactory
func FunctionOverRangeVectorOperatorFactory ¶
func FunctionOverRangeVectorOperatorFactory( name string, f functions.FunctionOverRangeVectorDefinition, ) InstantVectorFunctionOperatorFactory
FunctionOverRangeVectorOperatorFactory creates an InstantVectorFunctionOperatorFactory for functions that have exactly 1 argument (v range-vector).
Parameters:
- name: The name of the function
- f: The function implementation
func InstantVectorLabelManipulationFunctionOperatorFactory ¶
func InstantVectorLabelManipulationFunctionOperatorFactory(name string, metadataFunc functions.SeriesMetadataFunctionDefinition) InstantVectorFunctionOperatorFactory
InstantVectorLabelManipulationFunctionOperatorFactory creates an InstantVectorFunctionOperator for functions that have exactly 1 argument (v instant-vector), and need to manipulate the labels of each series without manipulating the returned samples. The values of v are passed through.
Parameters:
- name: The name of the function
- metadataFunc: The function for handling metadata
func InstantVectorTransformationFunctionOperatorFactory ¶
func InstantVectorTransformationFunctionOperatorFactory(name string, seriesDataFunc functions.InstantVectorSeriesFunction) InstantVectorFunctionOperatorFactory
InstantVectorTransformationFunctionOperatorFactory creates an InstantVectorFunctionOperatorFactory for functions that have exactly 1 argument (v instant-vector), and drop the series __name__ label.
Parameters:
- name: The name of the function
- seriesDataFunc: The function to handle series data
func LabelReplaceFunctionOperatorFactory ¶
func LabelReplaceFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
func RoundFunctionOperatorFactory ¶
func RoundFunctionOperatorFactory() InstantVectorFunctionOperatorFactory
func SingleInputVectorFunctionOperatorFactory ¶
func SingleInputVectorFunctionOperatorFactory(name string, f functions.FunctionOverInstantVectorDefinition) InstantVectorFunctionOperatorFactory
SingleInputVectorFunctionOperatorFactory creates an InstantVectorFunctionOperatorFactory for functions that have exactly 1 argument (v instant-vector).
Parameters:
- name: The name of the function
- f: The function implementation
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) Stats ¶
func (q *Query) Stats() *stats.Statistics
type QueryLimitsProvider ¶
type QueryLimitsProvider interface { // GetMaxEstimatedMemoryConsumptionPerQuery returns the maximum estimated memory allowed to be consumed by a query in bytes, or 0 to disable the limit. GetMaxEstimatedMemoryConsumptionPerQuery(ctx context.Context) (uint64, error) }
func NewStaticQueryLimitsProvider ¶
func NewStaticQueryLimitsProvider(maxEstimatedMemoryConsumptionPerQuery uint64) QueryLimitsProvider
NewStaticQueryLimitsProvider returns a QueryLimitsProvider that always returns the provided limits.
This should generally only be used in tests.
type ScalarFunctionOperatorFactory ¶
type ScalarFunctionOperatorFactory func( args []types.Operator, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, annotations *annotations.Annotations, expressionPosition posrange.PositionRange, timeRange types.QueryTimeRange, ) (types.ScalarOperator, error)