accumulator

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator[T int64 | float64] interface {
	Add(value []T) error
	Buckets() []T
	Count() uint64
	Sum() []T
	Avg() []T
}

All accumulators are treated as a histogram, This might not be very memory efficient, but it lets us treat them almost identically in the rest of the code.

type AccumulatorImpl

type AccumulatorImpl[T int64 | float64] struct {
	// contains filtered or unexported fields
}

func NewAccumulatorImlp

func NewAccumulatorImlp[T int64 | float64](buckets []T) *AccumulatorImpl[T]

func (*AccumulatorImpl[T]) Add

func (a *AccumulatorImpl[T]) Add(value []T) error

func (*AccumulatorImpl[T]) Avg

func (a *AccumulatorImpl[T]) Avg() []T

func (*AccumulatorImpl[T]) Buckets

func (a *AccumulatorImpl[T]) Buckets() []T

func (*AccumulatorImpl[T]) Count

func (a *AccumulatorImpl[T]) Count() uint64

func (*AccumulatorImpl[T]) Sum

func (a *AccumulatorImpl[T]) Sum() []T

Jump to

Keyboard shortcuts

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