2016-09-08 14:22:10 +00:00
|
|
|
package telegraf
|
|
|
|
|
2016-09-22 17:10:51 +00:00
|
|
|
// Aggregator is an interface for implementing an Aggregator plugin.
|
|
|
|
// the RunningAggregator wraps this interface and guarantees that
|
|
|
|
// Add, Push, and Reset can not be called concurrently, so locking is not
|
|
|
|
// required when implementing an Aggregator plugin.
|
2016-09-08 14:22:10 +00:00
|
|
|
type Aggregator interface {
|
2016-09-22 17:10:51 +00:00
|
|
|
// SampleConfig returns the default configuration of the Input.
|
2016-09-08 14:22:10 +00:00
|
|
|
SampleConfig() string
|
|
|
|
|
2016-09-22 17:10:51 +00:00
|
|
|
// Description returns a one-sentence description on the Input.
|
2016-09-08 14:22:10 +00:00
|
|
|
Description() string
|
|
|
|
|
2016-09-22 17:10:51 +00:00
|
|
|
// Add the metric to the aggregator.
|
|
|
|
Add(in Metric)
|
2016-09-08 14:22:10 +00:00
|
|
|
|
2016-09-22 17:10:51 +00:00
|
|
|
// Push pushes the current aggregates to the accumulator.
|
|
|
|
Push(acc Accumulator)
|
|
|
|
|
|
|
|
// Reset resets the aggregators caches and aggregates.
|
|
|
|
Reset()
|
2016-09-08 14:22:10 +00:00
|
|
|
}
|