monitoring

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GAUGE = iota
	COUNTER
	HISTOGRAM
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

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

func NewMetric

func NewMetric(class MetricClass, name string, labels ...string) *Metric

NewMetric creates a new Metric object, class needs to be one of type MetricClass, like the following * GAUGE = 0 * COUNTER = 1 * HISTOGRAM = 2

func (*Metric) Add

func (m *Metric) Add(value float64, tags map[string]string) error

func (*Metric) Collector

func (m *Metric) Collector() prometheus.Collector

func (*Metric) Dec

func (m *Metric) Dec(tags map[string]string) error

func (*Metric) Inc

func (m *Metric) Inc(tags map[string]string) error

func (*Metric) Name

func (m *Metric) Name() string

func (*Metric) Observe

func (m *Metric) Observe(value float64, tags map[string]string) error

func (*Metric) Set

func (m *Metric) Set(value float64, tags map[string]string) error

func (*Metric) Sub

func (m *Metric) Sub(value float64, tags map[string]string) error

type MetricClass

type MetricClass int

type MetricInterface

type MetricInterface interface {
	Inc(tags map[string]string) error
	Dec(tags map[string]string) error
	Add(value float64, tags map[string]string) error
	Sub(value float64, tags map[string]string) error
	Set(value float64, tags map[string]string) error
	Observe(value float64, tags map[string]string) error
	Collector() prometheus.Collector
	Name() string
}

Jump to

Keyboard shortcuts

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