metrics

package
v0.0.0-...-0820d52 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gauge

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

Gauge hold an int64 value that can be set arbitrarily

func NewGauge

func NewGauge() *Gauge

NewGauge constructs a new Gauge

func (*Gauge) Update

func (g *Gauge) Update(v int64)

Update updates the gauge's value

func (*Gauge) Value

func (g *Gauge) Value() int64

Value returns the gauge's current value

type Histogram

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

Histogram calculate distribution statistics from a series of int64 values.

func NewHistogram

func NewHistogram() *Histogram

NewHistogram constructs a new Histogram.

func (*Histogram) Update

func (h *Histogram) Update(v int64)

Update samples a new value.

type Rate

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

Rate tracks the rate of values per second

func NewRate

func NewRate() *Rate

NewRate creates a new rate metric

func (*Rate) Mark

func (r *Rate) Mark(n int64)

Mark records the occurance of n events.

type Registry

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

Registry is a registry of all metrics

func NewRegistry

func NewRegistry(name string) *Registry

NewRegistry creates a new Registry. name parameter is used as a root node name

func (*Registry) CreateSubRegistry

func (r *Registry) CreateSubRegistry(name string) *Registry

CreateSubRegistry creates inner Registry with the give name.

func (*Registry) GetMetricsRegistry

func (r *Registry) GetMetricsRegistry() metrics.Registry

GetMetricsRegistry returns global registry of metrics used in the solution

func (*Registry) RegisterGauge

func (r *Registry) RegisterGauge(name string, gauge *Gauge, units string) error

RegisterGauge registers a new gauge under the given name or returns an error

func (*Registry) RegisterHistogram

func (r *Registry) RegisterHistogram(name string, histogram *Histogram, units string) error

RegisterHistogram registers a new histogram under the given name or returns an error

func (*Registry) RegisterRate

func (r *Registry) RegisterRate(name string, rate *Rate) error

RegisterRate registers a new rate metric or returns an error

func (*Registry) RegisterTimer

func (r *Registry) RegisterTimer(name string, timer *Timer) error

RegisterTimer registers a new timer under the given name or returns an error

type Timer

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

Timer capture the duration and rate of events.

func NewTimer

func NewTimer() *Timer

NewTimer constructs a new Timer using an exponentially-decaying sample with the same reservoir size and alpha as UNIX load averages.

func (*Timer) Time

func (t *Timer) Time(f func())

Time record the duration of the execution of the given function.

Jump to

Keyboard shortcuts

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