Documentation
¶
Index ¶
- type BaseMetric
- type CounterMetric
- type GaugeMetric
- type Metric
- type MetricCounterVec
- type MetricGaugeVec
- type MetricStorage
- func (storage *MetricStorage) SendCounterMetric(metric string, value float64, labels map[string]string)
- func (storage *MetricStorage) SendGaugeMetric(metric string, value float64, labels map[string]string)
- func (storage *MetricStorage) Start()
- func (m *MetricStorage) Stop()
- func (m *MetricStorage) WithContext(ctx context.Context)
- type MetricVec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMetric ¶
func (*BaseMetric) LabelsNames ¶
func (metric *BaseMetric) LabelsNames() []string
type CounterMetric ¶
type CounterMetric struct {
BaseMetric
}
func NewCounterMetric ¶
func NewCounterMetric(metric string, value float64, labels map[string]string) *CounterMetric
type GaugeMetric ¶
type GaugeMetric struct {
BaseMetric
}
func NewGaugeMetric ¶
func NewGaugeMetric(metric string, value float64, labels map[string]string) *GaugeMetric
type MetricCounterVec ¶
type MetricCounterVec struct {
*prometheus.CounterVec
Name string
LabelNames []string
}
func NewMetricCounterVec ¶
func NewMetricCounterVec(counter *prometheus.CounterVec, name string, labelNames []string) *MetricCounterVec
func (*MetricCounterVec) UpdateValue ¶
func (metricVec *MetricCounterVec) UpdateValue(labels prometheus.Labels, value float64)
type MetricGaugeVec ¶
type MetricGaugeVec struct {
*prometheus.GaugeVec
Name string
LabelNames []string
}
func NewMetricGaugeVec ¶
func NewMetricGaugeVec(gauge *prometheus.GaugeVec, name string, labelNames []string) *MetricGaugeVec
func (*MetricGaugeVec) UpdateValue ¶
func (metricVec *MetricGaugeVec) UpdateValue(labels prometheus.Labels, value float64)
type MetricStorage ¶
type MetricStorage struct {
MetricChan chan Metric
MetricVecs map[string]MetricVec
// contains filtered or unexported fields
}
MetricStorage is used to synchronously register metric values.
func NewMetricStorage ¶
func NewMetricStorage() *MetricStorage
func (*MetricStorage) SendCounterMetric ¶
func (storage *MetricStorage) SendCounterMetric(metric string, value float64, labels map[string]string)
func (*MetricStorage) SendGaugeMetric ¶
func (storage *MetricStorage) SendGaugeMetric(metric string, value float64, labels map[string]string)
func (*MetricStorage) Start ¶
func (storage *MetricStorage) Start()
func (*MetricStorage) Stop ¶
func (m *MetricStorage) Stop()
func (*MetricStorage) WithContext ¶
func (m *MetricStorage) WithContext(ctx context.Context)
type MetricVec ¶
type MetricVec interface {
UpdateValue(labels prometheus.Labels, value float64)
}
Click to show internal directories.
Click to hide internal directories.