inputs

package
v0.0.0-...-967d409 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCallbackInput

func NewCallbackInput(delegate pipeline.Input, shutdown func() error) pipeline.Input

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

func NewLabelingInput(delegate pipeline.Input, labels map[string]string) pipeline.Input

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.

func NewSelector

func NewSelector(inputs map[string]pipeline.Input) pipeline.Input

NewSelector creates an Input that selects from the given inputs based on metric name. The inputs parameter is a map of metric name to the corresponding Input that handles it.

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.

Jump to

Keyboard shortcuts

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