metrics_storage

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMetric

type BaseMetric struct {
	Metric string
	Value  float64
	Labels map[string]string
}

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 Metric

type Metric interface {
	// contains filtered or unexported methods
}

Metrics collection methods Antiopa generates the following metrics: hooks errors - shell_operator_hook_errors{hook="hook_name"} counter increases when hook fails - shell_operator_hook_beareable_errors{hook="xxx"} a work counter - shell_operator_live_ticks counter increases every 5 sec. while shell_operator runs. queue length - shell_operator_tasks_queue_length

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
}

Структура MetricStorage - регистратор результатов

func Init

func Init() *MetricStorage

func NewMetricStorage

func NewMetricStorage() *MetricStorage

func (*MetricStorage) Run

func (storage *MetricStorage) Run()

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)

type MetricVec

type MetricVec interface {
	UpdateValue(labels prometheus.Labels, value float64)
}

Jump to

Keyboard shortcuts

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