stats

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

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

func (*Aggregator) Add

func (a *Aggregator) Add(ts time.Time, value float64) *Aggregator

func (Aggregator) Average

func (a Aggregator) Average() float64

func (*Aggregator) Clip

func (a *Aggregator) Clip(window time.Duration) *Aggregator

type ByWindow

type ByWindow = map[Window]float64

type Window

type Window struct{ time.Duration }

func (Window) MarshalText

func (w Window) MarshalText() ([]byte, error)

func (*Window) UnmarshalText

func (w *Window) UnmarshalText(b []byte) error

type WindowAggregators

type WindowAggregators map[Window]*Aggregator

func (WindowAggregators) Averages

func (a WindowAggregators) Averages(windows []time.Duration, ts time.Time, measure *float64) ByWindow

Jump to

Keyboard shortcuts

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