2016-01-28 05:21:36 +08:00
|
|
|
package telegraf
|
|
|
|
|
|
|
|
|
|
type Input interface {
|
2020-06-05 22:43:43 +08:00
|
|
|
PluginDescriber
|
2016-01-28 05:21:36 +08:00
|
|
|
|
|
|
|
|
// Gather takes in an accumulator and adds the metrics that the Input
|
2020-10-14 23:12:41 +08:00
|
|
|
// gathers. This is called every agent.interval
|
2016-01-28 05:21:36 +08:00
|
|
|
Gather(Accumulator) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ServiceInput interface {
|
2018-11-06 05:34:28 +08:00
|
|
|
Input
|
2016-01-28 05:21:36 +08:00
|
|
|
|
2018-11-06 05:34:28 +08:00
|
|
|
// Start the ServiceInput. The Accumulator may be retained and used until
|
|
|
|
|
// Stop returns.
|
2016-02-16 08:21:38 +08:00
|
|
|
Start(Accumulator) error
|
2016-01-28 05:21:36 +08:00
|
|
|
|
2020-10-14 23:12:41 +08:00
|
|
|
// Stop stops the services and closes any necessary channels and connections.
|
|
|
|
|
// Metrics should not be written out to the accumulator once stop returns, so
|
|
|
|
|
// Stop() should stop reading and wait for any in-flight metrics to write out
|
|
|
|
|
// to the accumulator before returning.
|
2016-01-28 05:21:36 +08:00
|
|
|
Stop()
|
|
|
|
|
}
|