prometheus

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Overview

Package prometheus implements a collector of DSMR metrics for Prometheus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSMRCollector

type DSMRCollector struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DSMRCollector implements the Prometheus Collector interface.

func (*DSMRCollector) Collect

func (dc *DSMRCollector) Collect(ch chan<- prometheus.Metric)

Collect implements part of the prometheus.Collector interface.

func (*DSMRCollector) Describe

func (dc *DSMRCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements part of the prometheus.Collector interface.

func (*DSMRCollector) Update

func (dc *DSMRCollector) Update(f dsmr.Frame)

Update all the metrics to the values of the given frame.

type MetricBuilder

type MetricBuilder struct {
	ValueType  prometheus.ValueType
	Desc       *prometheus.Desc
	Unit       string
	MetricFunc func(value float64) (prometheus.Metric, error)
}

MetricBuilder holds the information needed to create a Prometheus metrics.

func (MetricBuilder) CheckUnit

func (mb MetricBuilder) CheckUnit(unit string) bool

CheckUnit verifies if the given unit is expected for this object.

func (MetricBuilder) String

func (mb MetricBuilder) String() string

Jump to

Keyboard shortcuts

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