metrics

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheItem added in v0.1.5

type CacheItem struct {
	DeviceID string
	Metric   Metric
}

type Collector

type Collector interface {
	prometheus.Collector
	Observe(deviceID string, collection MetricCollection)
}

func NewCollector

func NewCollector(defaultTimeout time.Duration, possibleMetrics []config.MetricConfig, logger *zap.Logger) Collector

type Extractor added in v0.1.5

type Extractor func(topic string, payload []byte, deviceID string) (MetricCollection, error)

func NewJSONObjectExtractor added in v0.1.5

func NewJSONObjectExtractor(p Parser) Extractor

func NewMetricPerTopicExtractor added in v0.1.5

func NewMetricPerTopicExtractor(p Parser, metricNameRegex *config.Regexp) Extractor

type Ingest

type Ingest struct {
	// contains filtered or unexported fields
}

func NewIngest

func NewIngest(collector Collector, extractor Extractor, deviceIDRegex *config.Regexp) *Ingest

func (*Ingest) Collect added in v0.1.6

func (i *Ingest) Collect(metrics chan<- prometheus.Metric)

func (*Ingest) Collector added in v0.1.6

func (i *Ingest) Collector() prometheus.Collector

func (*Ingest) ConnectionLostHandler added in v0.1.6

func (i *Ingest) ConnectionLostHandler(client mqtt.Client, err error)

func (*Ingest) CountStoreError added in v0.1.5

func (i *Ingest) CountStoreError(topic string)

func (*Ingest) CountSuccess added in v0.1.5

func (i *Ingest) CountSuccess(topic string)

func (*Ingest) Describe added in v0.1.6

func (i *Ingest) Describe(desc chan<- *prometheus.Desc)

func (*Ingest) OnConnectHandler added in v0.1.6

func (i *Ingest) OnConnectHandler(client mqtt.Client)

func (*Ingest) SetupSubscriptionHandler

func (i *Ingest) SetupSubscriptionHandler(errChan chan<- error) mqtt.MessageHandler

type MemoryCachedCollector

type MemoryCachedCollector struct {
	// contains filtered or unexported fields
}

func (*MemoryCachedCollector) Collect

func (c *MemoryCachedCollector) Collect(mc chan<- prometheus.Metric)

func (*MemoryCachedCollector) Describe

func (c *MemoryCachedCollector) Describe(ch chan<- *prometheus.Desc)

func (*MemoryCachedCollector) Observe

func (c *MemoryCachedCollector) Observe(deviceID string, collection MetricCollection)

type Metric

type Metric struct {
	Description *prometheus.Desc
	Value       float64
	ValueType   prometheus.ValueType
	IngestTime  time.Time
	Topic       string
}

type MetricCollection

type MetricCollection []Metric

type Parser added in v0.1.5

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser added in v0.1.5

func NewParser(metrics []config.MetricConfig, separator string) Parser

Jump to

Keyboard shortcuts

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