model

package
v0.0.0-...-9405e06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Series

type Series struct {
	// ID is a numerical, zero-based identifier for a series.
	// It allows using slices instead of maps for fast lookups.
	ID     uint64
	Metric labels.Labels
}

type StepVector

type StepVector struct {
	T         int64
	SampleIDs []uint64
	Samples   []float64

	HistogramIDs []uint64
	Histograms   []*histogram.FloatHistogram
}

func (*StepVector) AppendHistogram

func (s *StepVector) AppendHistogram(pool *VectorPool, histogramID uint64, h *histogram.FloatHistogram)

func (*StepVector) AppendHistograms

func (s *StepVector) AppendHistograms(pool *VectorPool, histogramIDs []uint64, hs []*histogram.FloatHistogram)

func (*StepVector) AppendSample

func (s *StepVector) AppendSample(pool *VectorPool, id uint64, val float64)

func (*StepVector) AppendSamples

func (s *StepVector) AppendSamples(pool *VectorPool, ids []uint64, vals []float64)

func (*StepVector) RemoveHistogram

func (s *StepVector) RemoveHistogram(index int)

func (*StepVector) RemoveSample

func (s *StepVector) RemoveSample(index int)

type VectorOperator

type VectorOperator interface {
	// Next yields vectors of samples from all series for one or more execution steps.
	Next(ctx context.Context) ([]StepVector, 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)

	// GetPool returns pool of vectors that can be shared across operators.
	GetPool() *VectorPool

	// 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.

type VectorPool

type VectorPool struct {
	// contains filtered or unexported fields
}

func NewVectorPool

func NewVectorPool(stepsBatch int) *VectorPool

func NewVectorPoolWithSize

func NewVectorPoolWithSize(stepsBatch, size int) *VectorPool

func (*VectorPool) GetStepVector

func (p *VectorPool) GetStepVector(t int64) StepVector

func (*VectorPool) GetVectorBatch

func (p *VectorPool) GetVectorBatch() []StepVector

func (*VectorPool) PutStepVector

func (p *VectorPool) PutStepVector(v StepVector)

func (*VectorPool) PutVectors

func (p *VectorPool) PutVectors(vector []StepVector)

func (*VectorPool) SetStepSize

func (p *VectorPool) SetStepSize(n int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL