Documentation ¶
Index ¶
- func NewOrBinaryOperation(left types.InstantVectorOperator, right types.InstantVectorOperator, ...) types.InstantVectorOperator
- type AndUnlessBinaryOperation
- func (a *AndUnlessBinaryOperation) Close()
- func (a *AndUnlessBinaryOperation) ExpressionPosition() posrange.PositionRange
- func (a *AndUnlessBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
- func (a *AndUnlessBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
- type OrBinaryOperation
- func (o *OrBinaryOperation) Close()
- func (o *OrBinaryOperation) ExpressionPosition() posrange.PositionRange
- func (o *OrBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
- func (o *OrBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
- type ScalarScalarBinaryOperation
- type VectorScalarBinaryOperation
- func (v *VectorScalarBinaryOperation) Close()
- func (v *VectorScalarBinaryOperation) ExpressionPosition() posrange.PositionRange
- func (v *VectorScalarBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
- func (v *VectorScalarBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
- type VectorVectorBinaryOperation
- func (b *VectorVectorBinaryOperation) Close()
- func (b *VectorVectorBinaryOperation) ExpressionPosition() posrange.PositionRange
- func (b *VectorVectorBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
- func (b *VectorVectorBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOrBinaryOperation ¶
func NewOrBinaryOperation( left types.InstantVectorOperator, right types.InstantVectorOperator, vectorMatching parser.VectorMatching, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, timeRange types.QueryTimeRange, expressionPosition posrange.PositionRange, ) types.InstantVectorOperator
Types ¶
type AndUnlessBinaryOperation ¶
type AndUnlessBinaryOperation struct { Left types.InstantVectorOperator Right types.InstantVectorOperator VectorMatching parser.VectorMatching MemoryConsumptionTracker *limiting.MemoryConsumptionTracker IsUnless bool // If true, this operator represents an 'unless', if false, this operator represents an 'and' // contains filtered or unexported fields }
AndUnlessBinaryOperation represents a logical 'and' or 'unless' between two vectors.
func NewAndUnlessBinaryOperation ¶
func NewAndUnlessBinaryOperation( left types.InstantVectorOperator, right types.InstantVectorOperator, vectorMatching parser.VectorMatching, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, isUnless bool, timeRange types.QueryTimeRange, expressionPosition posrange.PositionRange, ) *AndUnlessBinaryOperation
func (*AndUnlessBinaryOperation) Close ¶
func (a *AndUnlessBinaryOperation) Close()
func (*AndUnlessBinaryOperation) ExpressionPosition ¶
func (a *AndUnlessBinaryOperation) ExpressionPosition() posrange.PositionRange
func (*AndUnlessBinaryOperation) NextSeries ¶
func (a *AndUnlessBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
func (*AndUnlessBinaryOperation) SeriesMetadata ¶
func (a *AndUnlessBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
type OrBinaryOperation ¶
type OrBinaryOperation struct { Left types.InstantVectorOperator Right types.InstantVectorOperator VectorMatching parser.VectorMatching MemoryConsumptionTracker *limiting.MemoryConsumptionTracker // contains filtered or unexported fields }
OrBinaryOperation represents a logical 'or' between two vectors.
func (*OrBinaryOperation) Close ¶
func (o *OrBinaryOperation) Close()
func (*OrBinaryOperation) ExpressionPosition ¶
func (o *OrBinaryOperation) ExpressionPosition() posrange.PositionRange
func (*OrBinaryOperation) NextSeries ¶
func (o *OrBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
func (*OrBinaryOperation) SeriesMetadata ¶
func (o *OrBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
type ScalarScalarBinaryOperation ¶
type ScalarScalarBinaryOperation struct { Left types.ScalarOperator Right types.ScalarOperator Op parser.ItemType MemoryConsumptionTracker *limiting.MemoryConsumptionTracker // contains filtered or unexported fields }
func NewScalarScalarBinaryOperation ¶
func NewScalarScalarBinaryOperation( left, right types.ScalarOperator, op parser.ItemType, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, expressionPosition posrange.PositionRange, ) (*ScalarScalarBinaryOperation, error)
func (*ScalarScalarBinaryOperation) Close ¶
func (s *ScalarScalarBinaryOperation) Close()
func (*ScalarScalarBinaryOperation) ExpressionPosition ¶
func (s *ScalarScalarBinaryOperation) ExpressionPosition() posrange.PositionRange
func (*ScalarScalarBinaryOperation) GetValues ¶
func (s *ScalarScalarBinaryOperation) GetValues(ctx context.Context) (types.ScalarData, error)
type VectorScalarBinaryOperation ¶
type VectorScalarBinaryOperation struct { Scalar types.ScalarOperator Vector types.InstantVectorOperator ScalarIsLeftSide bool Op parser.ItemType ReturnBool bool MemoryConsumptionTracker *limiting.MemoryConsumptionTracker // contains filtered or unexported fields }
VectorScalarBinaryOperation represents a binary operation between an instant vector and a scalar such as "<expr> + 2" or "3 * <expr>".
func NewVectorScalarBinaryOperation ¶
func NewVectorScalarBinaryOperation( scalar types.ScalarOperator, vector types.InstantVectorOperator, scalarIsLeftSide bool, op parser.ItemType, returnBool bool, timeRange types.QueryTimeRange, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, annotations *annotations.Annotations, expressionPosition posrange.PositionRange, ) (*VectorScalarBinaryOperation, error)
func (*VectorScalarBinaryOperation) Close ¶
func (v *VectorScalarBinaryOperation) Close()
func (*VectorScalarBinaryOperation) ExpressionPosition ¶
func (v *VectorScalarBinaryOperation) ExpressionPosition() posrange.PositionRange
func (*VectorScalarBinaryOperation) NextSeries ¶
func (v *VectorScalarBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
func (*VectorScalarBinaryOperation) SeriesMetadata ¶
func (v *VectorScalarBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
type VectorVectorBinaryOperation ¶
type VectorVectorBinaryOperation struct { Left types.InstantVectorOperator Right types.InstantVectorOperator Op parser.ItemType ReturnBool bool MemoryConsumptionTracker *limiting.MemoryConsumptionTracker VectorMatching parser.VectorMatching // contains filtered or unexported fields }
VectorVectorBinaryOperation represents a binary operation between instant vectors such as "<expr> + <expr>" or "<expr> - <expr>".
func NewVectorVectorBinaryOperation ¶
func NewVectorVectorBinaryOperation( left types.InstantVectorOperator, right types.InstantVectorOperator, vectorMatching parser.VectorMatching, op parser.ItemType, returnBool bool, memoryConsumptionTracker *limiting.MemoryConsumptionTracker, annotations *annotations.Annotations, expressionPosition posrange.PositionRange, ) (*VectorVectorBinaryOperation, error)
func (*VectorVectorBinaryOperation) Close ¶
func (b *VectorVectorBinaryOperation) Close()
func (*VectorVectorBinaryOperation) ExpressionPosition ¶
func (b *VectorVectorBinaryOperation) ExpressionPosition() posrange.PositionRange
func (*VectorVectorBinaryOperation) NextSeries ¶
func (b *VectorVectorBinaryOperation) NextSeries(ctx context.Context) (types.InstantVectorSeriesData, error)
func (*VectorVectorBinaryOperation) SeriesMetadata ¶
func (b *VectorVectorBinaryOperation) SeriesMetadata(ctx context.Context) ([]types.SeriesMetadata, error)
SeriesMetadata returns the series expected to be produced by this operator.
Note that it is possible that this method returns a series which will not have any points, as the list of possible output series is generated based solely on the series labels, not their data.
For example, if this operator is for a range query with the expression "left_metric + right_metric", but left_metric has points at T=0 and T=1 in the query range, and right_metric has points at T=2 and T=3 in the query range, then SeriesMetadata will return a series, but NextSeries will return no points for that series.
If this affects many series in the query, this may cause consuming operators to be less efficient, but in practice this rarely happens.
(The alternative would be to compute the entire result here in SeriesMetadata and only return the series that contain points, but that would mean we'd need to hold the entire result in memory at once, which we want to avoid.)