package push
import "go.opentelemetry.io/otel/sdk/metric/controller/push"
Index ¶
- type Clock
- type Controller
- func New(batcher export.Batcher, exporter export.Exporter, period time.Duration) *Controller
- func (c *Controller) Meter(name string) metric.Meter
- func (c *Controller) SetClock(clock Clock)
- func (c *Controller) SetErrorHandler(errorHandler sdk.ErrorHandler)
- func (c *Controller) Start()
- func (c *Controller) Stop()
- type Ticker
Types ¶
type Clock ¶
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 ¶
func (c *Controller) Meter(name 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.
type Ticker ¶
Source Files ¶
push.go
- Version
- v0.2.0
- Published
- Dec 3, 2019
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.