Documentation
¶
Index ¶
- type Metrics
- func (m *Metrics) BuiltinWebserver(bind string) error
- func (m *Metrics) DeleteZombieRobot(team string)
- func (m *Metrics) MQTTCallback(cl *mqtt.Client, sub packets.Subscription, pk packets.Packet)
- func (m *Metrics) ParseReport(teamNum string, data []byte) error
- func (m *Metrics) Registry() *prometheus.Registry
- func (m *Metrics) Shutdown()
- func (m *Metrics) StartFlusher()
- type Option
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 (*Metrics) BuiltinWebserver ¶ added in v0.1.6
BuiltinWebserver runs the metrics webserver when nothing else does.
func (*Metrics) DeleteZombieRobot ¶
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
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 ¶
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.