agg

package
v0.0.0-...-dff1495 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FloatEqDelta = 0.00001

Variables

This section is empty.

Functions

func Aggregators

func Aggregators() map[string]Config

func GetPercentileIndexes

func GetPercentileIndexes[T any](a []T) (int, int)

given a pre-sorted slice of values, returns the indexes of the percentiles

func Median

func Median[T any](a []T) T

given a pre-sorted slice of values, returns the median element

func Ptr

func Ptr[T any](v T) *T

func Register

func Register(cfg Config)

func ToDescriptiveStats

func ToDescriptiveStats(ss *stats.StreamStats) *model.DescriptiveStats

func ToOverviewStats

func ToOverviewStats(input *stats.Sample) *model.OverviewStats

Types

type Aggregator

type Aggregator interface {
	Add(result stats.Result)
	// TODO: Merge(other Aggregator) Aggregator for multi-threaded aggregations (optional optimization)
	Flush(result *model.SimulationStatistics)
}

type Config

type Config struct {
	Name string
	New  NewAggFunc
}

type LinearHist

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

taken from go-moremath. Need to reimplement for proto type compatibility

func NewLinearHist

func NewLinearHist(minval, maxval float64, nbins int) *LinearHist

NewLinearHist returns an empty histogram with nbins uniformly-sized bins spanning [min, max].

func (*LinearHist) Add

func (h *LinearHist) Add(x float64)

func (*LinearHist) BinToValue

func (h *LinearHist) BinToValue(bin float64) float64

func (*LinearHist) Counts

func (h *LinearHist) Counts() (uint32, []uint32, uint32)

type NewAggFunc

type NewAggFunc func(cfg *info.ActionList) (Aggregator, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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