2016-01-27 21:21:36 +00:00
|
|
|
package telegraf
|
|
|
|
|
|
|
|
type Output interface {
|
|
|
|
// Connect to the Output
|
|
|
|
Connect() error
|
|
|
|
// Close any connections to the Output
|
|
|
|
Close() error
|
|
|
|
// Description returns a one-sentence description on the Output
|
|
|
|
Description() string
|
|
|
|
// SampleConfig returns the default configuration of the Output
|
|
|
|
SampleConfig() string
|
|
|
|
// Write takes in group of points to be written to the Output
|
2016-01-27 23:15:14 +00:00
|
|
|
Write(metrics []Metric) error
|
2016-01-27 21:21:36 +00:00
|
|
|
}
|
|
|
|
|
2018-09-12 07:23:50 +00:00
|
|
|
// AggregatingOutput adds aggregating functionality to an Output. May be used
|
|
|
|
// if the Output only accepts a fixed set of aggregations over a time period.
|
|
|
|
// These functions may be called concurrently to the Write function.
|
2018-09-05 21:50:32 +00:00
|
|
|
type AggregatingOutput interface {
|
2018-09-12 07:23:50 +00:00
|
|
|
// Connect to the Output
|
|
|
|
Connect() error
|
|
|
|
// Close any connections to the Output
|
|
|
|
Close() error
|
|
|
|
// Description returns a one-sentence description on the Output
|
|
|
|
Description() string
|
|
|
|
// SampleConfig returns the default configuration of the Output
|
|
|
|
SampleConfig() string
|
|
|
|
// Write takes in group of points to be written to the Output
|
|
|
|
Write(metrics []Metric) error
|
|
|
|
|
|
|
|
// Add the metric to the aggregator
|
2018-09-05 21:50:32 +00:00
|
|
|
Add(in Metric)
|
2018-09-12 07:23:50 +00:00
|
|
|
// Push returns the aggregated metrics and is called every flush interval.
|
2018-09-05 21:50:32 +00:00
|
|
|
Push() []Metric
|
2018-09-12 07:23:50 +00:00
|
|
|
// Reset signals the the aggregator period is completed.
|
2018-09-05 21:50:32 +00:00
|
|
|
Reset()
|
|
|
|
}
|
|
|
|
|
2016-01-27 21:21:36 +00:00
|
|
|
type ServiceOutput interface {
|
|
|
|
// Connect to the Output
|
|
|
|
Connect() error
|
|
|
|
// Close any connections to the Output
|
|
|
|
Close() error
|
|
|
|
// Description returns a one-sentence description on the Output
|
|
|
|
Description() string
|
|
|
|
// SampleConfig returns the default configuration of the Output
|
|
|
|
SampleConfig() string
|
|
|
|
// Write takes in group of points to be written to the Output
|
2016-01-27 23:15:14 +00:00
|
|
|
Write(metrics []Metric) error
|
2018-09-12 07:23:50 +00:00
|
|
|
|
2016-01-27 21:21:36 +00:00
|
|
|
// Start the "service" that will provide an Output
|
|
|
|
Start() error
|
|
|
|
// Stop the "service" that will provide an Output
|
|
|
|
Stop()
|
|
|
|
}
|