accumulator

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: GPL-3.0 Imports: 4 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 {
	// contains filtered or unexported fields
}

func New

func New(period time.Duration, clock Clock, method WindowingMethod) *Accumulator

func (*Accumulator) Accumulate

func (acc *Accumulator) Accumulate(val float64) (Stats, error)

type Clock

type Clock interface {
	Now() time.Time
}

type Stats

type Stats struct {
	Minimum     float64
	Maximum     float64
	PeriodDelta float64
	Average     float64
}

type WindowingMethod

type WindowingMethod int
const (
	ROLLING WindowingMethod = iota
	CONSECUTIVE
)

Jump to

Keyboard shortcuts

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