Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller organizes a periodic push of metric data.
func New ¶
New constructs a Controller, an implementation of metric.Provider, using the provided batcher, exporter, and collection period to configure an SDK with periodic collection. The batcher itself is configured with the aggregation selector policy.
If the Exporter implements the export.LabelEncoder interface, the exporter will be used as the label encoder for the SDK itself, otherwise the SDK will be configured with the default label encoder.
func (*Controller) Meter ¶ added in v0.2.0
func (c *Controller) Meter(_ string) metric.Meter
Meter returns a named Meter, satisifying the metric.Provider interface.
func (*Controller) SetClock ¶
func (c *Controller) SetClock(clock Clock)
SetClock supports setting a mock clock for testing. This must be called before Start().
func (*Controller) SetErrorHandler ¶
func (c *Controller) SetErrorHandler(errorHandler sdk.ErrorHandler)
func (*Controller) Start ¶
func (c *Controller) Start()
Start begins a ticker that periodically collects and exports metrics with the configured interval.
func (*Controller) Stop ¶
func (c *Controller) Stop()
Stop waits for the background goroutine to return and then collects and exports metrics one last time before returning.