collector

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewTimeConstMetric

func MustNewTimeConstMetric(desc *prometheus.Desc, valueType prometheus.ValueType,
	value float64, timestampMs int64) prometheus.Metric

MustNewTimeConstMetric creates a new prometheus.Metric with a timestamp

func NewTimeConstMetric

func NewTimeConstMetric(desc *prometheus.Desc, valueType prometheus.ValueType,
	value float64, timestampMs int64) (prometheus.Metric, error)

NewTimeConstMetric creates a new prometheus.Metric with a timestamp

Types

type Collector added in v1.0.1

type Collector struct {
	Config  config.Config
	Channel chan *sample
	Samples map[string]*sample
	Mutex   *sync.Mutex
}

Collector is the main collector type

func NewCollector

func NewCollector(cfg config.Config) *Collector

NewCollector will define new NetFlow collector instance

func (*Collector) Collect added in v1.0.1

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect will collect the metrics

func (*Collector) Describe added in v1.0.1

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

Describe will describe the metrics

func (*Collector) Reader added in v1.0.1

func (c *Collector) Reader(udpSock *net.UDPConn)

Reader will read NetFlow UDP packets from the socket

Jump to

Keyboard shortcuts

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