From 2175a72fccf8c4b9b1f905255481d055ca5da957 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Mon, 3 Oct 2016 18:49:30 +0100 Subject: [PATCH] Rebase fixup --- agent/accumulator.go | 4 ++-- agent/agent.go | 7 ++----- cmd/telegraf/telegraf.go | 8 +------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/agent/accumulator.go b/agent/accumulator.go index 0a84cedd8..0d682d285 100644 --- a/agent/accumulator.go +++ b/agent/accumulator.go @@ -72,7 +72,7 @@ func (ac *accumulator) AddCounter( if m := ac.maker.MakeMetric(measurement, fields, tags, telegraf.Counter, ac.getTime(t)); m != nil { ac.metrics <- m } - } +} // AddError passes a runtime error to the accumulator. // The error will be tagged with the plugin name and written to the log. @@ -112,6 +112,6 @@ func (ac accumulator) getTime(t []time.Time) time.Time { timestamp = t[0] } else { timestamp = time.Now() + } return timestamp.Round(ac.precision) } -} diff --git a/agent/agent.go b/agent/agent.go index 0e2af0f9f..2df603cd4 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -122,7 +122,6 @@ func (a *Agent) gatherer( gatherWithTimeout(shutdown, input, acc, interval) elapsed := time.Since(start) - log.Printf("D! Input [%s] gathered metrics, (%s interval) in %s\n", input.Name(), interval, elapsed) @@ -304,7 +303,7 @@ func (a *Agent) flusher(shutdown chan struct{}, metricC chan telegraf.Metric) er mS := []telegraf.Metric{metric} for _, processor := range a.Config.Processors { mS = processor.Apply(mS...) - } + } for _, m := range mS { outMetricC <- m } @@ -366,9 +365,7 @@ func (a *Agent) Run(shutdown chan struct{}) error { } go func(in *models.RunningInput, interv time.Duration) { defer wg.Done() - if err := a.gatherer(shutdown, in, interv, metricC); err != nil { - log.Printf("E! " + err.Error()) - } + a.gatherer(shutdown, in, interv, metricC) }(input, interval) } diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index cf6d7158d..51a1a7bbf 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -12,8 +12,8 @@ import ( "github.com/influxdata/telegraf/agent" "github.com/influxdata/telegraf/internal/config" - _ "github.com/influxdata/telegraf/plugins/aggregators/all" "github.com/influxdata/telegraf/logger" + _ "github.com/influxdata/telegraf/plugins/aggregators/all" "github.com/influxdata/telegraf/plugins/inputs" _ "github.com/influxdata/telegraf/plugins/inputs/all" "github.com/influxdata/telegraf/plugins/outputs" @@ -112,8 +112,6 @@ Examples: telegraf -config telegraf.conf -input-filter cpu:mem -output-filter influxdb ` -var logger service.Logger - var stop chan struct{} var srvc service.Service @@ -309,10 +307,6 @@ func main() { if err != nil { log.Fatal(err) } - logger, err = s.Logger(nil) - if err != nil { - log.Fatal(err) - } // Handle the -service flag here to prevent any issues with tooling that // may not have an interactive session, e.g. installing from Ansible. if *fService != "" {