Documentation
¶
Index ¶
- Constants
- type Metric
- func (m *Metric) Add(value float64, tags map[string]string) error
- func (m *Metric) Collector() prometheus.Collector
- func (m *Metric) Dec(tags map[string]string) error
- func (m *Metric) Inc(tags map[string]string) error
- func (m *Metric) Name() string
- func (m *Metric) Observe(value float64, tags map[string]string) error
- func (m *Metric) Set(value float64, tags map[string]string) error
- func (m *Metric) Sub(value float64, tags map[string]string) error
- type MetricClass
- type MetricInterface
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) Collector ¶
func (m *Metric) Collector() prometheus.Collector
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
}
Click to show internal directories.
Click to hide internal directories.