metrics

package
v2.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Initializer

type Initializer interface {
	// NewCounter returns a function to increment for the given metric.
	NewCounter(name string) func(delta uint64)

	// NewGauge returns a function to set the value for the given metric.
	NewGauge(name string) func(value float64)
}

Metrics registers Counter and Gauge metrics.

type Map

type Map interface {
	// Add adds a new metric to the map.
	Add(key string, delta int64)

	// AddFloat adds a new metric to the map.
	AddFloat(key string, delta float64)

	// Get gets a Var from the Map.
	Get(key string) expvar.Var
}

Map stores the desired metrics.

type Metrics

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

Metrics stores health metrics for the process. It has a gauge and counter metrics.

func New

func New(m Map) *Metrics

New returns a new Metrics.

func (*Metrics) NewCounter

func (m *Metrics) NewCounter(name string) func(delta uint64)

NewCounter returns a func to be used increment the counter total.

func (*Metrics) NewGauge

func (m *Metrics) NewGauge(name string) func(value float64)

NewGauge returns a func to be used to set the value of a gauge metric.

type NullMetrics

type NullMetrics struct{}

NullMetrics are the default metrics.

func (NullMetrics) NewCounter

func (m NullMetrics) NewCounter(name string) func(uint64)

func (NullMetrics) NewGauge

func (m NullMetrics) NewGauge(name string) func(float64)

Jump to

Keyboard shortcuts

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