github.com/influxdata/telegraf@v1.30.3/input.go (about) 1 package telegraf 2 3 type Input interface { 4 PluginDescriber 5 6 // Gather takes in an accumulator and adds the metrics that the Input 7 // gathers. This is called every agent.interval 8 Gather(Accumulator) error 9 } 10 11 type ServiceInput interface { 12 Input 13 14 // Start the ServiceInput. The Accumulator may be retained and used until 15 // Stop returns. 16 Start(Accumulator) error 17 18 // Stop stops the services and closes any necessary channels and connections. 19 // Metrics should not be written out to the accumulator once stop returns, so 20 // Stop() should stop reading and wait for any in-flight metrics to write out 21 // to the accumulator before returning. 22 Stop() 23 }