metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Count

func Count(metricName string, count int64, labels map[string]string) error

func Gauge

func Gauge(metricName string, value interface{}, labels map[string]string) error

func Histogram

func Histogram(metricName string, value int64, labels map[string]string) error

func Increment

func Increment(metricName string, labels map[string]string) error

func SetVoid

func SetVoid()

func Setup

func Setup() error

Types

type CounterVec

type CounterVec interface {
	With(labels prometheus.Labels) prometheus.Counter
	Collect(chan<- prometheus.Metric)
	Describe(chan<- *prometheus.Desc)
}

type GaugeVec

type GaugeVec interface {
	With(labels prometheus.Labels) prometheus.Gauge
	Collect(chan<- prometheus.Metric)
	Describe(chan<- *prometheus.Desc)
}

type HistogramVec

type HistogramVec interface {
	With(labels prometheus.Labels) prometheus.Observer
	Collect(chan<- prometheus.Metric)
	Describe(chan<- *prometheus.Desc)
}

type MetricInstrument

type MetricInstrument interface {
	Increment(metricName string, labels map[string]string) error
	Count(metricName string, count int64, labels map[string]string) error
	Gauge(metricName string, value interface{}, labels map[string]string) error
	Histogram(metricName string, value int64, labels map[string]string) error
	Close()
}

func Instrument

func Instrument() MetricInstrument

Instrument returns the configured MetricInstrument should be called once Setup() is done.

type MockInstrument

type MockInstrument struct {
	mock.Mock
}

func (*MockInstrument) Close

func (m *MockInstrument) Close()

func (*MockInstrument) Count

func (m *MockInstrument) Count(metricName string, count int64, labels map[string]string) error

func (*MockInstrument) Gauge

func (m *MockInstrument) Gauge(metricName string, value interface{}, labels map[string]string) error

func (*MockInstrument) Histogram

func (m *MockInstrument) Histogram(metricName string, value int64, labels map[string]string) error

func (*MockInstrument) Increment

func (m *MockInstrument) Increment(metricName string, labels map[string]string) error

type PrometheusCollector

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

func (*PrometheusCollector) Close

func (p *PrometheusCollector) Close()

func (*PrometheusCollector) Count

func (p *PrometheusCollector) Count(metricName string, count int64, labels map[string]string) error

func (*PrometheusCollector) Gauge

func (p *PrometheusCollector) Gauge(metricName string, value interface{}, labels map[string]string) error

func (*PrometheusCollector) Histogram

func (p *PrometheusCollector) Histogram(metricName string, value int64, labels map[string]string) error

func (*PrometheusCollector) Increment

func (p *PrometheusCollector) Increment(metricName string, labels map[string]string) error

func (*PrometheusCollector) Register

func (p *PrometheusCollector) Register() error

type Statsd

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

func (*Statsd) Close

func (s *Statsd) Close()

func (*Statsd) Count

func (s *Statsd) Count(metricName string, count int64, labels map[string]string) error

func (*Statsd) Gauge

func (s *Statsd) Gauge(metricName string, value interface{}, labels map[string]string) error

func (*Statsd) Histogram

func (s *Statsd) Histogram(metricName string, value int64, labels map[string]string) error

func (*Statsd) Increment

func (s *Statsd) Increment(metricName string, labels map[string]string) error

Jump to

Keyboard shortcuts

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