Statsd listener plugin

implement gauges, sets, counters
This commit is contained in:
Cameron Sparr
2015-09-24 11:06:11 -07:00
parent 316fa1cc01
commit eb2a4dc724
9 changed files with 583 additions and 29 deletions

View File

@@ -20,11 +20,35 @@ type Accumulator interface {
}
type Plugin interface {
// SampleConfig returns the default configuration of the Plugin
SampleConfig() string
// Description returns a one-sentence description on the Plugin
Description() string
// Gather takes in an accumulator and adds the metrics that the Plugin
// gathers. This is called every "interval"
Gather(Accumulator) error
}
type ServicePlugin interface {
// SampleConfig returns the default configuration of the Plugin
SampleConfig() string
// Description returns a one-sentence description on the Plugin
Description() string
// Gather takes in an accumulator and adds the metrics that the Plugin
// gathers. This is called every "interval"
Gather(Accumulator) error
// Start starts the ServicePlugin's service, whatever that may be
Start() error
// Stop stops the services and closes any necessary channels and connections
Stop()
}
type Creator func() Plugin
var Plugins = map[string]Creator{}