Documentation ¶
Index ¶
- Constants
- func Aggregators() map[string]Config
- func GetPercentileIndexes[T any](a []T) (int, int)
- func Median[T any](a []T) T
- func Ptr[T any](v T) *T
- func Register(cfg Config)
- func ToDescriptiveStats(ss *stats.StreamStats) *model.DescriptiveStats
- func ToOverviewStats(input *stats.Sample) *model.OverviewStats
- type Aggregator
- type Config
- type LinearHist
- type NewAggFunc
Constants ¶
View Source
const FloatEqDelta = 0.00001
Variables ¶
This section is empty.
Functions ¶
func Aggregators ¶
func GetPercentileIndexes ¶
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 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
type NewAggFunc ¶
type NewAggFunc func(cfg *info.ActionList) (Aggregator, error)
Click to show internal directories.
Click to hide internal directories.