compute

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KahanSumInc

func KahanSumInc(inc, sum, c float64) (newSum, newC float64)

KahanSumInc implements kahan summation, see https://en.wikipedia.org/wiki/Kahan_summation_algorithm.

func Quantile

func Quantile(q float64, points []float64) float64

Types

type Accumulator

type Accumulator interface {
	Add(v float64, h *histogram.FloatHistogram) error
	Value() (float64, *histogram.FloatHistogram)
	ValueType() ValueType
	Reset(float64)
}

func NewQuantileAcc

func NewQuantileAcc() Accumulator

type AvgAcc

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

func NewAvgAcc

func NewAvgAcc() *AvgAcc

func (*AvgAcc) Add

func (*AvgAcc) AddVector

func (a *AvgAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error

func (*AvgAcc) Reset

func (a *AvgAcc) Reset(_ float64)

func (*AvgAcc) Value

func (a *AvgAcc) Value() (float64, *histogram.FloatHistogram)

func (*AvgAcc) ValueType

func (a *AvgAcc) ValueType() ValueType

type CountAcc

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

func NewCountAcc

func NewCountAcc() *CountAcc

func (*CountAcc) Add

func (*CountAcc) AddVector

func (c *CountAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error

func (*CountAcc) Reset

func (c *CountAcc) Reset(_ float64)

func (*CountAcc) Value

func (c *CountAcc) Value() (float64, *histogram.FloatHistogram)

func (*CountAcc) ValueType

func (c *CountAcc) ValueType() ValueType

type GroupAcc

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

func NewGroupAcc

func NewGroupAcc() *GroupAcc

func (*GroupAcc) Add

func (*GroupAcc) AddVector

func (c *GroupAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error

func (*GroupAcc) Reset

func (c *GroupAcc) Reset(_ float64)

func (*GroupAcc) Value

func (c *GroupAcc) Value() (float64, *histogram.FloatHistogram)

func (*GroupAcc) ValueType

func (c *GroupAcc) ValueType() ValueType

type HistogramAvgAcc

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

func NewHistogramAvgAcc

func NewHistogramAvgAcc() *HistogramAvgAcc

func (*HistogramAvgAcc) Add

func (*HistogramAvgAcc) Reset

func (acc *HistogramAvgAcc) Reset(f float64)

func (*HistogramAvgAcc) Value

func (*HistogramAvgAcc) ValueType

func (acc *HistogramAvgAcc) ValueType() ValueType

type MaxAcc

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

func NewMaxAcc

func NewMaxAcc() *MaxAcc

func (*MaxAcc) Add

func (*MaxAcc) AddVector

func (c *MaxAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error

func (*MaxAcc) Reset

func (c *MaxAcc) Reset(_ float64)

func (*MaxAcc) Value

func (c *MaxAcc) Value() (float64, *histogram.FloatHistogram)

func (*MaxAcc) ValueType

func (c *MaxAcc) ValueType() ValueType

type MinAcc

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

func NewMinAcc

func NewMinAcc() *MinAcc

func (*MinAcc) Add

func (*MinAcc) AddVector

func (c *MinAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error

func (*MinAcc) Reset

func (c *MinAcc) Reset(_ float64)

func (*MinAcc) Value

func (c *MinAcc) Value() (float64, *histogram.FloatHistogram)

func (*MinAcc) ValueType

func (c *MinAcc) ValueType() ValueType

type QuantileAcc

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

func (*QuantileAcc) Add

func (*QuantileAcc) Reset

func (q *QuantileAcc) Reset(f float64)

func (*QuantileAcc) Value

func (*QuantileAcc) ValueType

func (q *QuantileAcc) ValueType() ValueType

type StdDevAcc

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

func NewStdDevAcc

func NewStdDevAcc() *StdDevAcc

func (*StdDevAcc) Add

func (*StdDevAcc) Reset

func (s *StdDevAcc) Reset(_ float64)

func (*StdDevAcc) Value

func (s *StdDevAcc) Value() (float64, *histogram.FloatHistogram)

func (*StdDevAcc) ValueType

func (s *StdDevAcc) ValueType() ValueType

type StdVarAcc

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

func NewStdVarAcc

func NewStdVarAcc() *StdVarAcc

func (*StdVarAcc) Add

func (*StdVarAcc) Reset

func (s *StdVarAcc) Reset(_ float64)

func (*StdVarAcc) Value

func (s *StdVarAcc) Value() (float64, *histogram.FloatHistogram)

func (*StdVarAcc) ValueType

func (s *StdVarAcc) ValueType() ValueType

type SumAcc

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

func NewSumAcc

func NewSumAcc() *SumAcc

func (*SumAcc) Add

func (*SumAcc) AddVector

func (s *SumAcc) AddVector(float64s []float64, histograms []*histogram.FloatHistogram) error

func (*SumAcc) Reset

func (s *SumAcc) Reset(_ float64)

func (*SumAcc) Value

func (s *SumAcc) Value() (float64, *histogram.FloatHistogram)

func (*SumAcc) ValueType

func (s *SumAcc) ValueType() ValueType

type ValueType

type ValueType int
const (
	NoValue ValueType = iota
	SingleTypeValue
	MixedTypeValue
)

type VectorAccumulator

type VectorAccumulator interface {
	AddVector(vs []float64, hs []*histogram.FloatHistogram) error
	Value() (float64, *histogram.FloatHistogram)
	ValueType() ValueType
	Reset(float64)
}

Jump to

Keyboard shortcuts

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