collection

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 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 Bucket

type Bucket struct {
	Sum   float64
	Count int64
}

type RollingWindow

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

func NewRollingWindow

func NewRollingWindow(size int, interval time.Duration, opts ...RollingWindowOption) *RollingWindow

func (*RollingWindow) Add

func (rw *RollingWindow) Add(v float64)

func (*RollingWindow) Reduce

func (rw *RollingWindow) Reduce(fn func(b *Bucket))

type RollingWindowOption

type RollingWindowOption func(rollingWindow *RollingWindow)

func IgnoreCurrentBucket

func IgnoreCurrentBucket() RollingWindowOption

Jump to

Keyboard shortcuts

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