Documentation
¶
Index ¶
- func ContextWithOperatorID(ctx context.Context, id uint64) context.Context
- func OperatorIDFromContext(ctx context.Context) (uint64, bool)
- type OperatorIDer
- type Series
- type StepVector
- func (s *StepVector) AppendHistogram(histogramID uint64, h *histogram.FloatHistogram)
- func (s *StepVector) AppendHistogramWithSizeHint(histogramID uint64, h *histogram.FloatHistogram, hint int)
- func (s *StepVector) AppendHistograms(histogramIDs []uint64, hs []*histogram.FloatHistogram)
- func (s *StepVector) AppendSample(id uint64, val float64)
- func (s *StepVector) AppendSampleWithSizeHint(id uint64, val float64, hint int)
- func (s *StepVector) AppendSamples(ids []uint64, vals []float64)
- func (s *StepVector) RemoveHistogram(index int)
- func (s *StepVector) RemoveSample(index int)
- func (s *StepVector) Reset(t int64)
- type Unwrapper
- type VectorOperator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithOperatorID ¶ added in v0.6.0
ContextWithOperatorID returns a copy of ctx carrying the given operator ID.
Types ¶
type OperatorIDer ¶ added in v0.6.0
type OperatorIDer interface {
OperatorID() uint64
}
OperatorIDer is an optional interface for operators that carry a deterministic fingerprint derived from their logical plan subtree. Only data-fetching operators implement this; pure-computation operators do not.
type StepVector ¶
type StepVector struct {
T int64
SampleIDs []uint64
Samples []float64
HistogramIDs []uint64
Histograms []*histogram.FloatHistogram
}
func (*StepVector) AppendHistogram ¶
func (s *StepVector) AppendHistogram(histogramID uint64, h *histogram.FloatHistogram)
func (*StepVector) AppendHistogramWithSizeHint ¶ added in v0.5.0
func (s *StepVector) AppendHistogramWithSizeHint(histogramID uint64, h *histogram.FloatHistogram, hint int)
AppendHistogramWithSizeHint appends a histogram and lazily pre-allocates capacity if needed. Use this when you know the expected number of histograms to avoid repeated slice growth.
func (*StepVector) AppendHistograms ¶
func (s *StepVector) AppendHistograms(histogramIDs []uint64, hs []*histogram.FloatHistogram)
func (*StepVector) AppendSample ¶
func (s *StepVector) AppendSample(id uint64, val float64)
func (*StepVector) AppendSampleWithSizeHint ¶ added in v0.5.0
func (s *StepVector) AppendSampleWithSizeHint(id uint64, val float64, hint int)
AppendSampleWithSizeHint appends a sample and lazily pre-allocates capacity if needed. Use this when you know the expected number of samples to avoid repeated slice growth.
func (*StepVector) AppendSamples ¶
func (s *StepVector) AppendSamples(ids []uint64, vals []float64)
func (*StepVector) RemoveHistogram ¶
func (s *StepVector) RemoveHistogram(index int)
func (*StepVector) RemoveSample ¶
func (s *StepVector) RemoveSample(index int)
func (*StepVector) Reset ¶ added in v0.5.0
func (s *StepVector) Reset(t int64)
Reset resets the StepVector to the given timestamp while preserving slice capacity.
type Unwrapper ¶ added in v0.6.0
type Unwrapper interface {
Unwrap() VectorOperator
}
type VectorOperator ¶
type VectorOperator interface {
// Next yields vectors of samples from all series for one or more execution steps.
// The caller provides a buffer (buf) to be filled with StepVectors.
// Returns the number of StepVectors written to buf and any error encountered.
// A return value of 0 indicates no more data is available.
Next(ctx context.Context, buf []StepVector) (int, error)
// Series returns all series that the operator will process during Next results.
// The result can be used by upstream operators to allocate output tables and buffers
// before starting to process samples.
Series(ctx context.Context) ([]labels.Labels, error)
// Explain returns human-readable explanation of the current operator and optional nested operators.
Explain() (next []VectorOperator)
fmt.Stringer
}
VectorOperator performs operations on series in step by step fashion.
func Unwrap ¶ added in v0.6.0
func Unwrap(op VectorOperator) VectorOperator
func WithID ¶ added in v0.6.0
func WithID(op VectorOperator, id uint64) VectorOperator
WithID wraps op so that it implements OperatorIDer.