metrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package metrics contains modules that collect data or metrics from other modules.

The preferred way to collect metrics is to send an event from the target module onto the event loop, which can then be received by a metric module for processing before being written to a data file using the metrics logger.

A ticker is used to determine how often metrics should be logged. To receive tick events, you can add an observer for a types.TickEvent on the metrics logger. When receiving the tick event, you should write the relevant data to the MetricsLogger module as a protobuf message.

The event loop is accessed through the EventLoop() method of the module system, and the metrics logger is accessed through the MetricsLogger() method of the module system.

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 metrics 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
Package plotting provides functions and structures for plotting measurement data collected from running an experiment.
Package plotting provides functions and structures for plotting measurement data collected from running an experiment.

Jump to

Keyboard shortcuts

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