metrics

package
v0.0.0-...-b78484e Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DurationHistogram

type DurationHistogram struct {
	N          int
	OutOfRange int
	sync.RWMutex
	// contains filtered or unexported fields
}

DurationHistogram is a histogram divided into N adjacent configurable ranges.

func NewDurationHistogram

func NewDurationHistogram(steps, ends []time.Duration) (h DurationHistogram)

func (*DurationHistogram) Push

func (h *DurationHistogram) Push(d time.Duration)

Push adds the duration to the histogram.

func (*DurationHistogram) String

func (h *DurationHistogram) String(width int) (s string, oorp float64)

String returns the histogram with the maximum specified width, and a percentage of values that are out of range.

type DurationStats

type DurationStats struct {
	Total time.Duration
	N     uint
	Min   time.Duration
	Max   time.Duration
	// contains filtered or unexported fields
}

DurationStats keeps basic time.Duration statistics. Welford's method is used to keep a running mean and standard deviation.

func (*DurationStats) IsZero

func (s *DurationStats) IsZero() bool

func (*DurationStats) Mean

func (s *DurationStats) Mean() time.Duration

func (*DurationStats) Push

func (s *DurationStats) Push(d time.Duration)

func (*DurationStats) Stddev

func (s *DurationStats) Stddev() time.Duration

func (*DurationStats) Variance

func (s *DurationStats) Variance() float64

Jump to

Keyboard shortcuts

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