metric_storage

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 12

Documentation

Index

Constants

View Source
const (
	PrefixTemplate = "{PREFIX}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricStorage

type MetricStorage struct {
	Prefix string

	Counters         map[string]*prometheus.CounterVec
	Gauges           map[string]*prometheus.GaugeVec
	Histograms       map[string]*prometheus.HistogramVec
	HistogramBuckets map[string][]float64

	GroupedVault *vault.GroupedVault

	Registry   *prometheus.Registry
	Gatherer   prometheus.Gatherer
	Registerer prometheus.Registerer
	// contains filtered or unexported fields
}

MetricStorage is used to register metric values.

func NewMetricStorage

func NewMetricStorage() *MetricStorage

func (*MetricStorage) ApplyGroupOperations

func (m *MetricStorage) ApplyGroupOperations(group string, ops []operation.MetricOperation, commonLabels map[string]string)

ApplyGroupOperations set metrics for group to a new state defined by ops.

func (*MetricStorage) ApplyOperation

func (m *MetricStorage) ApplyOperation(op operation.MetricOperation, commonLabels map[string]string)

func (*MetricStorage) Counter

func (m *MetricStorage) Counter(metric string, labels map[string]string) *prometheus.CounterVec

Counter

func (*MetricStorage) CounterAdd

func (m *MetricStorage) CounterAdd(metric string, value float64, labels map[string]string)

func (*MetricStorage) Gauge

func (m *MetricStorage) Gauge(metric string, labels map[string]string) *prometheus.GaugeVec

Gauge return saved or register a new gauge.

func (*MetricStorage) GaugeAdd

func (m *MetricStorage) GaugeAdd(metric string, value float64, labels map[string]string)

func (*MetricStorage) GaugeSet

func (m *MetricStorage) GaugeSet(metric string, value float64, labels map[string]string)

func (*MetricStorage) Handler

func (m *MetricStorage) Handler() http.Handler

func (*MetricStorage) Histogram

func (m *MetricStorage) Histogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec

func (*MetricStorage) HistogramObserve

func (m *MetricStorage) HistogramObserve(metric string, value float64, labels map[string]string, buckets []float64)

Histograms

func (*MetricStorage) RegisterCounter

func (m *MetricStorage) RegisterCounter(metric string, labels map[string]string) *prometheus.CounterVec

RegisterCounter registers a counter.

func (*MetricStorage) RegisterGauge

func (m *MetricStorage) RegisterGauge(metric string, labels map[string]string) *prometheus.GaugeVec

RegisterGauge registers a gauge.

func (*MetricStorage) RegisterHistogram

func (m *MetricStorage) RegisterHistogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec

func (*MetricStorage) ResolveMetricName

func (m *MetricStorage) ResolveMetricName(name string) string

func (*MetricStorage) SendBatch

func (m *MetricStorage) SendBatch(ops []operation.MetricOperation, labels map[string]string) error

func (*MetricStorage) SendBatchV0

func (m *MetricStorage) SendBatchV0(ops []operation.MetricOperation, labels map[string]string) error

func (*MetricStorage) Start

func (m *MetricStorage) Start()

func (*MetricStorage) Stop

func (m *MetricStorage) Stop()

func (*MetricStorage) WithContext

func (m *MetricStorage) WithContext(ctx context.Context)

func (*MetricStorage) WithNewRegistry

func (m *MetricStorage) WithNewRegistry()

func (*MetricStorage) WithPrefix

func (m *MetricStorage) WithPrefix(prefix string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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