metrics

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 4 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, unit string) func(value float64)
}

Metrics registers Counter and Gauge metrics.

type Metrics

type Metrics struct {
	Registry *prometheus.Registry
}

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

func New

func New() *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, unit string) func(value float64)

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

func (*Metrics) NewSummary

func (m *Metrics) NewSummary(name, unit string) func(value float64)

NewSummary returns a func to be used to set the value of a summary metric.

func (*Metrics) ServeHTTP

func (m *Metrics) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NullMetrics

type NullMetrics struct{}

nopMetrics are the default metrics.

func (NullMetrics) NewCounter

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

func (NullMetrics) NewGauge

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

func (NullMetrics) NewSummary

func (m NullMetrics) NewSummary(name, unit string) func(float64)

Jump to

Keyboard shortcuts

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