Files
telegraf/models/input.go
Cameron Sparr 2df8dd6dbd Use an internal 'Metric' data type for telegraf metrics
As of now, this is pretty much just a wrapper around client.Point, but
this gives latitude to expand functionality more easily.

closes #564
2016-01-25 16:14:11 -07:00

32 lines
879 B
Go

package models
type Input interface {
// SampleConfig returns the default configuration of the Input
SampleConfig() string
// Description returns a one-sentence description on the Input
Description() string
// Gather takes in an accumulator and adds the metrics that the Input
// gathers. This is called every "interval"
Gather(Accumulator) error
}
type ServiceInput interface {
// SampleConfig returns the default configuration of the Input
SampleConfig() string
// Description returns a one-sentence description on the Input
Description() string
// Gather takes in an accumulator and adds the metrics that the Input
// gathers. This is called every "interval"
Gather(Accumulator) error
// Start starts the ServiceInput's service, whatever that may be
Start() error
// Stop stops the services and closes any necessary channels and connections
Stop()
}