monitoring

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 3 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 added in v1.2.0

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

func NewMetric added in v1.2.0

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 added in v1.2.0

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

func (*Metric) Collector added in v1.2.0

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

func (*Metric) Dec added in v1.2.0

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

func (*Metric) Inc added in v1.2.0

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

func (*Metric) Name added in v1.2.0

func (m *Metric) Name() string

func (*Metric) Observe added in v1.2.0

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

func (*Metric) Set added in v1.2.0

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

func (*Metric) Sub added in v1.2.0

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

type MetricClass added in v1.2.0

type MetricClass int

type MetricInterface added in v1.2.0

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

type MonitorInterface

type MonitorInterface interface {
	GetMetric(string) (MetricInterface, error)
	AddMetrics(...MetricInterface) error
	GetService() string
	GetLogger() logging.LoggerInterface
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳