Fix compilation errors

This commit is contained in:
Pavel Yudin 2016-01-29 18:18:55 +03:00
parent 6a6db3430f
commit 6591b6bb00
2 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import (
"strings"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
@ -34,7 +35,7 @@ func (p *Powerdns) Description() string {
return "Read metrics from one or many PowerDNS servers"
}
func (p *Powerdns) Gather(acc inputs.Accumulator) error {
func (p *Powerdns) Gather(acc telegraf.Accumulator) error {
if len(p.UnixSockets) == 0 {
return p.gatherServer("/var/run/pdns.controlsocket", acc)
}
@ -48,7 +49,7 @@ func (p *Powerdns) Gather(acc inputs.Accumulator) error {
return nil
}
func (p *Powerdns) gatherServer(address string, acc inputs.Accumulator) error {
func (p *Powerdns) gatherServer(address string, acc telegraf.Accumulator) error {
conn, err := net.DialTimeout("unix", address, defaultTimeout)
if err != nil {
return err
@ -119,7 +120,7 @@ func parseResponse(metrics string) (map[string]interface{}, error) {
}
func init() {
inputs.Add("powerdns", func() inputs.Input {
inputs.Add("powerdns", func() telegraf.Input {
return &Powerdns{}
})
}

View File

@ -131,7 +131,7 @@ func TestPowerdnsParseMetrics(t *testing.T) {
continue
}
if value != test.value {
t.Errorf("Metric: %s, Expected: %s, actual: %s",
t.Errorf("Metric: %s, Expected: %d, actual: %d",
test.key, test.value, value)
}
}