rate

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 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 Gauge

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

Gauge represents an exponentially-weighted moving average of given values

func NewGauge

func NewGauge() *Gauge

NewGauge constructs a new Gauge and launches a goroutine. Be sure to call Stop() once the meter is of no use to allow for garbage collection.

func (*Gauge) Mark

func (g *Gauge) Mark(v int64)

Mark records the the current value of the gauge.

func (*Gauge) Rate1

func (g *Gauge) Rate1() float64

Rate1 returns the one-minute moving average of the gauge values. Cannot be larger than max(largest input value, 0)

func (*Gauge) Rate15

func (g *Gauge) Rate15() float64

Rate15 returns the fifteen-minute moving average of the gauge values. Cannot be larger than max(largest input value, 0)

func (*Gauge) Rate5

func (g *Gauge) Rate5() float64

Rate5 returns the five-minute moving average of the gauge values. Cannot be larger than max(largest input value, 0)

func (*Gauge) RateMean

func (g *Gauge) RateMean() float64

RateMean returns the gauge's mean value. Cannot be larger than max(largest input value, 0)

func (*Gauge) Stop

func (g *Gauge) Stop()

Stop stops the gauge

Jump to

Keyboard shortcuts

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