package stat

import "github.com/DataDog/sketches-go/ddsketch/stat"

Index

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

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

Source Files

summary.go

Version
v1.4.7 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
1 week ago

Tools for package owners.