move plugin interfaces into separate package

This commit is contained in:
David Norton
2016-12-23 10:18:27 -05:00
parent 3e6c4a53a4
commit 81caa56859
182 changed files with 817 additions and 817 deletions

View File

@@ -9,11 +9,11 @@ import (
"strconv"
"strings"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins"
"github.com/influxdata/telegraf/plugins/inputs"
)
func (z *Zfs) gatherPoolStats(acc telegraf.Accumulator) (string, error) {
func (z *Zfs) gatherPoolStats(acc plugins.Accumulator) (string, error) {
lines, err := z.zpool()
if err != nil {
@@ -76,7 +76,7 @@ func (z *Zfs) gatherPoolStats(acc telegraf.Accumulator) (string, error) {
return strings.Join(pools, "::"), nil
}
func (z *Zfs) Gather(acc telegraf.Accumulator) error {
func (z *Zfs) Gather(acc plugins.Accumulator) error {
kstatMetrics := z.KstatMetrics
if len(kstatMetrics) == 0 {
kstatMetrics = []string{"arcstats", "zfetchstats", "vdev_cache_stats"}
@@ -131,7 +131,7 @@ func sysctl(metric string) ([]string, error) {
}
func init() {
inputs.Add("zfs", func() telegraf.Input {
inputs.Add("zfs", func() plugins.Input {
return &Zfs{
sysctl: sysctl,
zpool: zpool,

View File

@@ -8,7 +8,7 @@ import (
"strconv"
"strings"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/plugins/inputs"
)
@@ -44,7 +44,7 @@ func getTags(pools []poolInfo) map[string]string {
return map[string]string{"pools": poolNames}
}
func gatherPoolStats(pool poolInfo, acc telegraf.Accumulator) error {
func gatherPoolStats(pool poolInfo, acc plugins.Accumulator) error {
lines, err := internal.ReadLines(pool.ioFilename)
if err != nil {
return err
@@ -77,7 +77,7 @@ func gatherPoolStats(pool poolInfo, acc telegraf.Accumulator) error {
return nil
}
func (z *Zfs) Gather(acc telegraf.Accumulator) error {
func (z *Zfs) Gather(acc plugins.Accumulator) error {
kstatMetrics := z.KstatMetrics
if len(kstatMetrics) == 0 {
kstatMetrics = []string{"arcstats", "zfetchstats", "vdev_cache_stats"}
@@ -125,7 +125,7 @@ func (z *Zfs) Gather(acc telegraf.Accumulator) error {
}
func init() {
inputs.Add("zfs", func() telegraf.Input {
inputs.Add("zfs", func() plugins.Input {
return &Zfs{}
})
}

View File

@@ -3,16 +3,16 @@
package zfs
import (
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins"
"github.com/influxdata/telegraf/plugins/inputs"
)
func (z *Zfs) Gather(acc telegraf.Accumulator) error {
func (z *Zfs) Gather(acc plugins.Accumulator) error {
return nil
}
func init() {
inputs.Add("zfs", func() telegraf.Input {
inputs.Add("zfs", func() plugins.Input {
return &Zfs{}
})
}