Documentation ¶
Overview ¶
Package statscollector implements plugin that collects the statistics from vpp interfaces and publishes them to prometheus.
Index ¶
- Variables
- type API
- type Deps
- type Option
- type Plugin
- func (p *Plugin) Close() error
- func (p *Plugin) HandlesEvent(event controller.Event) bool
- func (p *Plugin) Init() error
- func (p *Plugin) PrintStats()
- func (p *Plugin) Put(key string, data proto.Message, opts ...datasync.PutOption) error
- func (p *Plugin) RegisterGaugeFunc(name string, help string, valueFunc func() float64)
- func (p *Plugin) Resync(controller.Event, controller.KubeStateData, int, controller.ResyncOperations) error
- func (p *Plugin) Revert(controller.Event) error
- func (p *Plugin) Update(event controller.Event, _ controller.UpdateOperations) (changeDescription string, err error)
Constants ¶
This section is empty.
Variables ¶
var DefaultPlugin = *NewPlugin()
DefaultPlugin is default instance of Plugin.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // RegisterGaugeFunc registers a new gauge with specific name, help string and valueFunc to report status when invoked. RegisterGaugeFunc(name string, help string, valueFunc func() float64) }
API defines API of the stats collector plugin. Currently it only allows registering of a gauge.
type Deps ¶
type Deps struct { infra.PluginDeps ServiceLabel servicelabel.ReaderAPI // IPv4Net plugin is used to lookup pod connected by the given interface IPv4Net ipv4net.API // Prometheus plugin used to stream statistics Prometheus prometheusplugin.API }
Deps groups the dependencies of the Plugin.
type Option ¶
type Option func(*Plugin)
Option is a function that acts on a Plugin to inject Dependencies or configuration
type Plugin ¶
Plugin collects the statistics from vpp interfaces and publishes them to prometheus.
func (*Plugin) HandlesEvent ¶
func (p *Plugin) HandlesEvent(event controller.Event) bool
HandlesEvent selects DeletePod events.
func (*Plugin) PrintStats ¶
func (p *Plugin) PrintStats()
PrintStats periodically dumps stats to log
func (*Plugin) RegisterGaugeFunc ¶
RegisterGaugeFunc registers a new gauge with specific name, help string and valueFunc to report status when invoked.
func (*Plugin) Resync ¶
func (p *Plugin) Resync(controller.Event, controller.KubeStateData, int, controller.ResyncOperations) error
Resync is NOOP - statscollector does not support re-synchronization.
func (*Plugin) Revert ¶
func (p *Plugin) Revert(controller.Event) error
Revert is NOOP - only BestEffort DeletePod event is handled.
func (*Plugin) Update ¶
func (p *Plugin) Update(event controller.Event, _ controller.UpdateOperations) (changeDescription string, err error)
Update is called for the DeletePod event.