metrics

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics binds the registry as well as the metrics collection.

func New

func New(opts ...Option) *Metrics

New returns an initialized instance of the metrics system.

func (*Metrics) BuiltinWebserver added in v0.1.6

func (m *Metrics) BuiltinWebserver(bind string) error

BuiltinWebserver runs the metrics webserver when nothing else does.

func (*Metrics) DeleteZombieRobot

func (m *Metrics) DeleteZombieRobot(team string)

DeleteZombieRobot removes metrics associated with a zombie robot that is no longer connected.

func (*Metrics) MQTTCallback added in v0.1.6

func (m *Metrics) MQTTCallback(cl *mqtt.Client, sub packets.Subscription, pk packets.Packet)

MQTTCallback is called by external callers to process packets.

func (*Metrics) ParseReport added in v0.1.7

func (m *Metrics) ParseReport(teamNum string, data []byte) error

ParseReport directly parses a report from a buffer.

func (*Metrics) Registry

func (m *Metrics) Registry() *prometheus.Registry

Registry provides access to the registry that this instance manages.

func (*Metrics) Shutdown

func (m *Metrics) Shutdown()

Shutdown signals the flusher that we wish to cease operations.

func (*Metrics) StartFlusher

func (m *Metrics) StartFlusher()

StartFlusher clears the stats for robots every 10 seconds ensuring that robots don't stick around as zombies in the system if they've disconnected.

type Option

type Option func(m *Metrics)

Option provides a configuration framework to setup the metrics package.

func WithBroker

func WithBroker(b string) Option

WithBroker points the metrics exporter at the mqtt broker that the robots will be talking to.

func WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger provides a non-nil logger for the metrics instance to interact with.

Jump to

Keyboard shortcuts

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