metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientMetrics

func GetClientMetrics(names ...string) (metrics []interface{})

GetClientMetrics constructs a new instance of each named metric.

func GetReplicaMetrics

func GetReplicaMetrics(names ...string) (metrics []interface{})

GetReplicaMetrics constructs a new instance of each named metric.

func RegisterClientMetric

func RegisterClientMetric(name string, constructor func() interface{})

RegisterClientMetric registers the constructor of a client metric.

func RegisterReplicaMetric

func RegisterReplicaMetric(name string, constructor func() interface{})

RegisterReplicaMetric registers the constructor of a replica metric.

Types

type ClientLatency

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

ClientLatency processes LatencyMeasurementEvents, and writes LatencyMeasurements to the metrics logger.

func (*ClientLatency) InitModule

func (lr *ClientLatency) InitModule(mods *modules.Modules)

InitModule gives the module access to the other modules.

type Throughput

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

Throughput measures throughput in commits per second, and commands per second.

func (*Throughput) InitModule

func (t *Throughput) InitModule(mods *modules.Modules)

InitModule gives the module access to the other modules.

type Ticker

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

Ticker emits TickEvents on the data event loop.

func NewTicker

func NewTicker(interval time.Duration) *Ticker

NewTicker returns a new ticker.

func (*Ticker) InitModule

func (t *Ticker) InitModule(mods *modules.Modules)

InitModule gives the module access to the other modules.

type ViewTimeouts

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

ViewTimeouts is a metric that measures the number of view timeouts that happen.

func (*ViewTimeouts) InitModule

func (vt *ViewTimeouts) InitModule(mods *modules.Modules)

InitModule gives the module access to the other modules.

type Welford

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

Welford is an implementation of Welford's online algorithm for calculating variance.

func (*Welford) Count

func (w *Welford) Count() uint64

Count returns the total number of values that have been added to the variance estimate.

func (*Welford) Get

func (w *Welford) Get() (mean, variance float64, count uint64)

Get returns the current mean and sample variance estimate.

func (*Welford) Reset

func (w *Welford) Reset()

Reset resets all values to 0.

func (*Welford) Update

func (w *Welford) Update(val float64)

Update adds the value to the current estimate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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