forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor handling of MinMax functionality into RunningAggregator
allows for easier addition of a sliding window at a later time. Also makes `period` be a generic argument for all aggregator plugins.
- Loading branch information
Showing
7 changed files
with
252 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
package telegraf | ||
|
||
// 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. | ||
type Aggregator interface { | ||
// SampleConfig returns the default configuration of the Input | ||
// SampleConfig returns the default configuration of the Input. | ||
SampleConfig() string | ||
|
||
// Description returns a one-sentence description on the Input | ||
// Description returns a one-sentence description on the Input. | ||
Description() string | ||
|
||
// Apply the metric to the aggregator | ||
Apply(in Metric) | ||
// Add the metric to the aggregator. | ||
Add(in Metric) | ||
|
||
// Start starts the service filter with the given accumulator | ||
Start(acc Accumulator) error | ||
Stop() | ||
// Push pushes the current aggregates to the accumulator. | ||
Push(acc Accumulator) | ||
|
||
// Reset resets the aggregators caches and aggregates. | ||
Reset() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.