Create public models for telegraf metrics, accumlator, plugins

This will basically make the root directory a place for storing the
major telegraf interfaces, which will make telegraf's godoc looks quite
a bit nicer. And make it easier for contributors to lookup the few data
types that they actually care about.

closes #564
This commit is contained in:
Cameron Sparr
2016-01-27 14:21:36 -07:00
parent a822d942cd
commit 9c0d14bb60
83 changed files with 699 additions and 525 deletions

View File

@@ -5,6 +5,7 @@ import (
"net"
"strings"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
@@ -31,7 +32,7 @@ func (_ *NetIOStats) SampleConfig() string {
return netSampleConfig
}
func (s *NetIOStats) Gather(acc inputs.Accumulator) error {
func (s *NetIOStats) Gather(acc telegraf.Accumulator) error {
netio, err := s.ps.NetIO()
if err != nil {
return fmt.Errorf("error getting net io info: %s", err)
@@ -103,7 +104,7 @@ func (s *NetIOStats) Gather(acc inputs.Accumulator) error {
}
func init() {
inputs.Add("net", func() inputs.Input {
inputs.Add("net", func() telegraf.Input {
return &NetIOStats{ps: &systemPS{}}
})
}