Documentation
¶
Index ¶
- func KahanSumInc(inc, sum, c float64) (newSum, newC float64)
- func Quantile(q float64, points []float64) float64
- type Accumulator
- type AvgAcc
- func (a *AvgAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (a *AvgAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error
- func (a *AvgAcc) Reset(_ float64)
- func (a *AvgAcc) Value() (float64, *histogram.FloatHistogram)
- func (a *AvgAcc) ValueType() ValueType
- func (a *AvgAcc) Warnings() warnings.Warnings
- type CountAcc
- func (c *CountAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (c *CountAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error
- func (c *CountAcc) Reset(_ float64)
- func (c *CountAcc) Value() (float64, *histogram.FloatHistogram)
- func (c *CountAcc) ValueType() ValueType
- func (c *CountAcc) Warnings() warnings.Warnings
- type CounterResetState
- type GroupAcc
- func (c *GroupAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (c *GroupAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error
- func (c *GroupAcc) Reset(_ float64)
- func (c *GroupAcc) Value() (float64, *histogram.FloatHistogram)
- func (c *GroupAcc) ValueType() ValueType
- func (c *GroupAcc) Warnings() warnings.Warnings
- type HistogramAvgAcc
- func (acc *HistogramAvgAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (acc *HistogramAvgAcc) Reset(f float64)
- func (acc *HistogramAvgAcc) Value() (float64, *histogram.FloatHistogram)
- func (acc *HistogramAvgAcc) ValueType() ValueType
- func (acc *HistogramAvgAcc) Warnings() warnings.Warnings
- type LastAcc
- type MaxAcc
- func (c *MaxAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (c *MaxAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error
- func (c *MaxAcc) Reset(_ float64)
- func (c *MaxAcc) Value() (float64, *histogram.FloatHistogram)
- func (c *MaxAcc) ValueType() ValueType
- func (c *MaxAcc) Warnings() warnings.Warnings
- type MinAcc
- func (c *MinAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (c *MinAcc) AddVector(vs []float64, hs []*histogram.FloatHistogram) error
- func (c *MinAcc) Reset(_ float64)
- func (c *MinAcc) Value() (float64, *histogram.FloatHistogram)
- func (c *MinAcc) ValueType() ValueType
- func (c *MinAcc) Warnings() warnings.Warnings
- type QuantileAcc
- type StdDevAcc
- type StdVarAcc
- type SumAcc
- func (s *SumAcc) Add(v float64, h *histogram.FloatHistogram) error
- func (s *SumAcc) AddVector(float64s []float64, histograms []*histogram.FloatHistogram) error
- func (s *SumAcc) Reset(_ float64)
- func (s *SumAcc) Value() (float64, *histogram.FloatHistogram)
- func (s *SumAcc) ValueType() ValueType
- func (s *SumAcc) Warnings() warnings.Warnings
- type ValueType
- type VectorAccumulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KahanSumInc ¶
KahanSumInc implements kahan summation, see https://en.wikipedia.org/wiki/Kahan_summation_algorithm.
Types ¶
type Accumulator ¶
type Accumulator interface {
Add(v float64, h *histogram.FloatHistogram) error
Value() (float64, *histogram.FloatHistogram)
ValueType() ValueType
Warnings() warnings.Warnings
Reset(float64)
}
Accumulators map prometheus behavior for aggregations, either operators or "[...]_over_time" functions. The caller is responsible to add all errors returned by Add as annotations. The Warnings method returns a bitset of warning conditions that occurred during accumulation (e.g., ignored histograms, mixed types).
func NewQuantileAcc ¶
func NewQuantileAcc() Accumulator
type AvgAcc ¶
type AvgAcc struct {
// contains filtered or unexported fields
}
type CountAcc ¶
type CountAcc struct {
// contains filtered or unexported fields
}
func NewCountAcc ¶
func NewCountAcc() *CountAcc
type CounterResetState ¶ added in v0.5.0
type CounterResetState uint8
CounterResetState tracks which counter reset hints have been seen during aggregation. Used to detect collisions between CounterReset and NotCounterReset hints.
const ( SeenCounterReset CounterResetState = 1 << iota // histogram with CounterReset hint was seen SeenNotCounterReset // histogram with NotCounterReset hint was seen )
func (CounterResetState) HasCollision ¶ added in v0.5.0
func (s CounterResetState) HasCollision() bool
HasCollision returns true if both CounterReset and NotCounterReset hints were seen.
type GroupAcc ¶
type GroupAcc struct {
// contains filtered or unexported fields
}
func NewGroupAcc ¶
func NewGroupAcc() *GroupAcc
type HistogramAvgAcc ¶
type HistogramAvgAcc struct {
// contains filtered or unexported fields
}
func NewHistogramAvgAcc ¶
func NewHistogramAvgAcc() *HistogramAvgAcc
func (*HistogramAvgAcc) Add ¶
func (acc *HistogramAvgAcc) Add(v float64, h *histogram.FloatHistogram) error
func (*HistogramAvgAcc) Reset ¶
func (acc *HistogramAvgAcc) Reset(f float64)
func (*HistogramAvgAcc) Value ¶
func (acc *HistogramAvgAcc) Value() (float64, *histogram.FloatHistogram)
func (*HistogramAvgAcc) ValueType ¶
func (acc *HistogramAvgAcc) ValueType() ValueType
func (*HistogramAvgAcc) Warnings ¶ added in v0.5.0
func (acc *HistogramAvgAcc) Warnings() warnings.Warnings
type LastAcc ¶ added in v0.5.0
type LastAcc struct {
// contains filtered or unexported fields
}
LastAcc tracks the last value seen. Used for last_over_time.
func NewLastAcc ¶ added in v0.5.0
func NewLastAcc() *LastAcc
func (*LastAcc) Add ¶ added in v0.5.0
func (l *LastAcc) Add(v float64, h *histogram.FloatHistogram) error
type MaxAcc ¶
type MaxAcc struct {
// contains filtered or unexported fields
}
type MinAcc ¶
type MinAcc struct {
// contains filtered or unexported fields
}
type QuantileAcc ¶
type QuantileAcc struct {
// contains filtered or unexported fields
}
func (*QuantileAcc) Add ¶
func (q *QuantileAcc) Add(v float64, h *histogram.FloatHistogram) error
func (*QuantileAcc) Reset ¶
func (q *QuantileAcc) Reset(f float64)
func (*QuantileAcc) Value ¶
func (q *QuantileAcc) Value() (float64, *histogram.FloatHistogram)
func (*QuantileAcc) ValueType ¶
func (q *QuantileAcc) ValueType() ValueType
func (*QuantileAcc) Warnings ¶ added in v0.5.0
func (q *QuantileAcc) Warnings() warnings.Warnings
type StdDevAcc ¶
type StdDevAcc struct {
// contains filtered or unexported fields
}
func NewStdDevAcc ¶
func NewStdDevAcc() *StdDevAcc
type StdVarAcc ¶
type StdVarAcc struct {
// contains filtered or unexported fields
}
func NewStdVarAcc ¶
func NewStdVarAcc() *StdVarAcc
type SumAcc ¶
type SumAcc struct {
// contains filtered or unexported fields
}
type VectorAccumulator ¶
type VectorAccumulator interface {
AddVector(vs []float64, hs []*histogram.FloatHistogram) error
Value() (float64, *histogram.FloatHistogram)
ValueType() ValueType
Warnings() warnings.Warnings
Reset(float64)
}
VectorAccumulator is like Accumulator but accepts batches of values.