Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCallbackInput ¶
NewCallbackInput creates an Input that calls the given shutdown hook when the Input is released. Shutdown is called before the Input's own delegate is released.
func NewLabelingInput ¶
NewLabelingInput creates an Input that adds the given additional labels to incoming MetricReports before passing reports to the given delegate. If a report already contains a label with the same name, the original label is retained and a warning is logged.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator is the head of the metrics reporting pipeline. It accepts reports from the reporting client, buffers and aggregates for a configured amount of time, and sends them downstream. See pipeline.Pipeline.
func NewAggregator ¶
func NewAggregator(metric metrics.Definition, bufferTime time.Duration, input pipeline.Input, persistence persistence.Persistence) *Aggregator
NewAggregator creates a new Aggregator instance and starts its goroutine.
func (*Aggregator) AddReport ¶
func (h *Aggregator) AddReport(report metrics.MetricReport) error
AddReport adds a report. Reports are aggregated when possible, during a time period defined by the Aggregator's config object. Two reports can be aggregated if they have the same name, contain the same labels, and don't contain overlapping time ranges denoted by StartTime and EndTme.
func (*Aggregator) Release ¶
func (h *Aggregator) Release() error
Release decrements the Aggregator's usage count. If it reaches 0, Release instructs the Aggregator's goroutine to shutdown. Any currently-aggregated metrics will be reported to the downstream sender as part of this process. Release blocks until the operation has completed. See pipeline.Component.Release.
func (*Aggregator) Use ¶
func (h *Aggregator) Use()
Use increments the Aggregator's usage count. See pipeline.Component.Use.