move plugin interfaces into separate package
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/plugins"
|
||||
"github.com/influxdata/telegraf/plugins/inputs"
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ func (t *Twemproxy) Description() string {
|
||||
}
|
||||
|
||||
// Gather data from all Twemproxy instances
|
||||
func (t *Twemproxy) Gather(acc telegraf.Accumulator) error {
|
||||
func (t *Twemproxy) Gather(acc plugins.Accumulator) error {
|
||||
conn, err := net.DialTimeout("tcp", t.Addr, 1*time.Second)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -56,7 +56,7 @@ func (t *Twemproxy) Gather(acc telegraf.Accumulator) error {
|
||||
|
||||
// Process Twemproxy server stats
|
||||
func (t *Twemproxy) processStat(
|
||||
acc telegraf.Accumulator,
|
||||
acc plugins.Accumulator,
|
||||
tags map[string]string,
|
||||
data map[string]interface{},
|
||||
) {
|
||||
@@ -90,7 +90,7 @@ func (t *Twemproxy) processStat(
|
||||
|
||||
// Process pool data in Twemproxy stats
|
||||
func (t *Twemproxy) processPool(
|
||||
acc telegraf.Accumulator,
|
||||
acc plugins.Accumulator,
|
||||
tags map[string]string,
|
||||
data map[string]interface{},
|
||||
) {
|
||||
@@ -118,7 +118,7 @@ func (t *Twemproxy) processPool(
|
||||
|
||||
// Process backend server(redis/memcached) stats
|
||||
func (t *Twemproxy) processServer(
|
||||
acc telegraf.Accumulator,
|
||||
acc plugins.Accumulator,
|
||||
tags map[string]string,
|
||||
data map[string]interface{},
|
||||
) {
|
||||
@@ -144,7 +144,7 @@ func copyTags(tags map[string]string) map[string]string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
inputs.Add("twemproxy", func() telegraf.Input {
|
||||
inputs.Add("twemproxy", func() plugins.Input {
|
||||
return &Twemproxy{}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user