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 {
|
2020-06-05 14:43:43 +00:00
|
|
|
PluginDescriber
|
2016-09-08 14:22:10 +00:00
|
|
|
|
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
|
|
|
}
|