metricproducer

package
v0.20.1-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 2 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager maintains a list of active producers. Producers can register with the manager to allow readers to read all metrics provided by them. Readers can retrieve all producers registered with the manager, read metrics from the producers and export them.

func GlobalManager

func GlobalManager() *Manager

GlobalManager is a single instance of producer manager that is used by all producers and all readers.

func (*Manager) AddProducer

func (pm *Manager) AddProducer(producer Producer)

AddProducer adds the producer to the Manager if it is not already present.

func (*Manager) DeleteProducer

func (pm *Manager) DeleteProducer(producer Producer)

DeleteProducer deletes the producer from the Manager if it is present.

func (*Manager) GetAll

func (pm *Manager) GetAll() []Producer

GetAll returns a slice of all producer currently registered with the Manager. For each call it generates a new slice. The slice should not be cached as registration may change at any time. It is typically called periodically by exporter to read metrics from the producers.

type Producer

type Producer interface {
	// Read should return the current values of all metrics supported by this
	// metric provider.
	// The returned metrics should be unique for each combination of name and
	// resource.
	Read() []*metricdata.Metric
}

Producer is a source of metrics.

Jump to

Keyboard shortcuts

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