math

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EwmaRate added in v1.9.0

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

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

func NewEWMARate added in v1.9.0

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

func (*EwmaRate) Add added in v1.9.0

func (r *EwmaRate) Add(delta int64)

func (*EwmaRate) Inc added in v1.9.0

func (r *EwmaRate) Inc()

Inc counts one event.

func (*EwmaRate) Rate added in v1.9.0

func (r *EwmaRate) Rate() float64

Rate returns the per-second rate.

func (*EwmaRate) Tick added in v1.9.0

func (r *EwmaRate) Tick()

Tick assumes to be called every r.interval.

type MaxTracker added in v1.17.0

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

func (*MaxTracker) Load added in v1.17.0

func (m *MaxTracker) Load() int64

func (*MaxTracker) Tick added in v1.17.0

func (m *MaxTracker) Tick()

func (*MaxTracker) Track added in v1.17.0

func (m *MaxTracker) Track(max int64)

Jump to

Keyboard shortcuts

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