stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

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

Stats tracks numeric values in a sliding window and can produce summaries.

func NewStats

func NewStats(windowSize time.Duration) *Stats

func NewStatsWithClock

func NewStatsWithClock(windowSize time.Duration, clk clock.Clock) *Stats

func (*Stats) Add

func (s *Stats) Add(value int64)

func (*Stats) Average

func (s *Stats) Average() (float64, bool)

func (*Stats) Len

func (s *Stats) Len() int

func (*Stats) Merge

func (s *Stats) Merge(other *Stats)

func (*Stats) Percentile

func (s *Stats) Percentile(percentiles []float64) ([]int64, bool)

func (*Stats) Values

func (s *Stats) Values() []int64

Jump to

Keyboard shortcuts

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