collector

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "monibuca"
)

Variables

View Source
var GlobalLabel prometheus.Labels

Functions

func Available

func Available() []string

func RegisterCollector

func RegisterCollector(name string, builder CollectorBuilder)

Types

type Collector

type Collector interface {
	prometheus.Collector
	OnEvent(event any)
}

func Build

func Build(collector string, cfg config.Config) (Collector, error)

func NewNetworkCollector

func NewNetworkCollector(cfg config.Config) (Collector, error)

type CollectorBuilder

type CollectorBuilder func(cfg config.Config) (Collector, error)

type NetworkCollector

type NetworkCollector struct {
	BytesReceivedTotal *prometheus.Desc
	BytesSentTotal     *prometheus.Desc
	BytesTotal         *prometheus.Desc

	BytesReceiveSpeed *prometheus.Desc
	BytesSentSpeed    *prometheus.Desc

	PacketsReceivedTotal *prometheus.Desc
	PacketsSentTotal     *prometheus.Desc
	PacketsTotal         *prometheus.Desc

	ErrIn    *prometheus.Desc
	ErrOut   *prometheus.Desc
	ErrTotal *prometheus.Desc
	// contains filtered or unexported fields
}

A NetworkCollector is a Prometheus Collector for Perflib Network Interface metrics

func (*NetworkCollector) Collect

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

func (*NetworkCollector) Describe

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

func (*NetworkCollector) OnEvent

func (c *NetworkCollector) OnEvent(event any)

Jump to

Keyboard shortcuts

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