perfstats

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator struct {
	Samples int64
	Total   float64
}

Two scalars (N samples and X total amount), which can measure total and average values.

func (*Accumulator) AddSample

func (a *Accumulator) AddSample(v float64)

func (*Accumulator) Average

func (a *Accumulator) Average() float64

func (*Accumulator) Reset

func (a *Accumulator) Reset()

type Int64Accumulator

type Int64Accumulator struct {
	Samples int64
	Total   int64
}

Two scalars (N samples and X total amount), which can measure total and average values.

func (*Int64Accumulator) AddSample

func (a *Int64Accumulator) AddSample(v int64)

func (*Int64Accumulator) Average

func (a *Int64Accumulator) Average() float64

func (*Int64Accumulator) Reset

func (a *Int64Accumulator) Reset()

type TimeAccumulator

type TimeAccumulator struct {
	Samples int64
	Total   time.Duration
}

Accumulate samples of how long something took

func (*TimeAccumulator) AddSample

func (a *TimeAccumulator) AddSample(v time.Duration)

func (*TimeAccumulator) Average

func (a *TimeAccumulator) Average() time.Duration

func (*TimeAccumulator) Reset

func (a *TimeAccumulator) Reset()

Jump to

Keyboard shortcuts

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