stat

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SummaryStatistics

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

SummaryStatistics keeps track of the count, the sum, the min and the max of recorded values. We use a compensated sum to avoid accumulating rounding errors (see https://en.wikipedia.org/wiki/Kahan_summation_algorithm).

func NewSummaryStatistics

func NewSummaryStatistics() *SummaryStatistics

func NewSummaryStatisticsFromData added in v1.3.0

func NewSummaryStatisticsFromData(count, sum, min, max float64) (*SummaryStatistics, error)

NewSummaryStatisticsFromData constructs SummaryStatistics from the provided data.

func (*SummaryStatistics) Add

func (s *SummaryStatistics) Add(value, count float64)

func (*SummaryStatistics) AddToCount

func (s *SummaryStatistics) AddToCount(addend float64)

func (*SummaryStatistics) AddToSum

func (s *SummaryStatistics) AddToSum(addend float64)

func (*SummaryStatistics) Clear

func (s *SummaryStatistics) Clear()

func (*SummaryStatistics) Copy

func (*SummaryStatistics) Count

func (s *SummaryStatistics) Count() float64

func (*SummaryStatistics) Max

func (s *SummaryStatistics) Max() float64

func (*SummaryStatistics) MergeWith

func (s *SummaryStatistics) MergeWith(o *SummaryStatistics)

func (*SummaryStatistics) Min

func (s *SummaryStatistics) Min() float64

func (*SummaryStatistics) Rescale

func (s *SummaryStatistics) Rescale(factor float64)

Rescale adjusts the statistics so that they are equal to what they would have been if AddWithCount had been called with values multiplied by factor.

func (*SummaryStatistics) Reweight

func (s *SummaryStatistics) Reweight(factor float64)

Reweight adjusts the statistics so that they are equal to what they would have been if AddWithCount had been called with counts multiplied by factor.

func (*SummaryStatistics) Sum

func (s *SummaryStatistics) Sum() float64

Jump to

Keyboard shortcuts

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