movingcounter

package
v0.0.0-...-77610c5 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

type Int64Value

type Int64Value int64

func (Int64Value) Add

func (v Int64Value) Add(a Value) Value

func (Int64Value) Max

func (v Int64Value) Max(a Value) Value

func (Int64Value) Min

func (v Int64Value) Min(a Value) Value

func (Int64Value) Sub

func (v Int64Value) Sub(a Value) Value

type MovingCounter

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

func NewMovingCounter

func NewMovingCounter(clock Clock, period time.Duration, numBuckets int, zero Value) *MovingCounter

func (*MovingCounter) Add

func (c *MovingCounter) Add(val Value)

func (*MovingCounter) Max

func (c *MovingCounter) Max() Value

func (*MovingCounter) Min

func (c *MovingCounter) Min() Value

func (*MovingCounter) Total

func (c *MovingCounter) Total() (Value, uint64)

type Value

type Value interface {
	Add(a Value) Value
	Sub(a Value) Value
	Min(a Value) Value
	Max(a Value) Value
}

Jump to

Keyboard shortcuts

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