stats

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mean

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

Mean tracks an average statistic.

The zero value is ready to use. Mean.Record may be called concurrently, but not with Mean.Get.

func (*Mean) Get

func (m *Mean) Get() float64

Get returns the mean value of this statistic.

func (*Mean) Merge

func (m *Mean) Merge(that *Mean)

Merge adds all of the samples from that to m.

func (*Mean) Record

func (m *Mean) Record(sample float64)

Record records a sample.

type Median

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

Median tracks a median statistic.

Must be constructed with NewMedian. Median.Record may be called concurrently, but not with Median.Get.

func NewMedian

func NewMedian(n int) *Median

NewMedian returns a new median statistic which remembers the last n samples.

n should be relatively large, at least 100.

func (*Median) Get

func (m *Median) Get() float64

Get returns the median value of this statistic.

func (*Median) Record

func (m *Median) Record(sample float64)

Record records a sample.

Jump to

Keyboard shortcuts

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