math

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max(a, b int) int

Max returns the maximum of two ints

func Max64

func Max64(a, b int64) int64

Max64 returns the maximum of two int64s

func Min

func Min(a, b int) int

Min returns the minimum of two ints

func Min64

func Min64(a, b int64) int64

Min64 returns the minimum of two int64s

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.

Jump to

Keyboard shortcuts

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