ewma

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 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 Rate

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

Rate tracks an exponentially weighted moving average of a per-second rate.

func NewEWMARate

func NewEWMARate(alpha float64, interval time.Duration) *Rate

NewEWMARate always allocates a new ewmaRate, as this guarantees the atomically accessed int64 will be aligned on ARM. See prometheus#2666.

func (*Rate) Incr

func (r *Rate) Incr(incr int64)

Incr counts incr events.

func (*Rate) Rate

func (r *Rate) Rate() float64

Rate returns the per-second rate.

func (*Rate) Tick

func (r *Rate) Tick()

Tick assumes to be called every r.interval.

Jump to

Keyboard shortcuts

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