metrics_storage

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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