Rebase fixup

This commit is contained in:
Cameron Sparr 2016-10-03 18:49:30 +01:00
parent b03c1d9691
commit 2175a72fcc
3 changed files with 5 additions and 14 deletions

View File

@ -72,7 +72,7 @@ func (ac *accumulator) AddCounter(
if m := ac.maker.MakeMetric(measurement, fields, tags, telegraf.Counter, ac.getTime(t)); m != nil { if m := ac.maker.MakeMetric(measurement, fields, tags, telegraf.Counter, ac.getTime(t)); m != nil {
ac.metrics <- m ac.metrics <- m
} }
} }
// AddError passes a runtime error to the accumulator. // AddError passes a runtime error to the accumulator.
// The error will be tagged with the plugin name and written to the log. // 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] timestamp = t[0]
} else { } else {
timestamp = time.Now() timestamp = time.Now()
}
return timestamp.Round(ac.precision) return timestamp.Round(ac.precision)
} }
}

View File

@ -122,7 +122,6 @@ func (a *Agent) gatherer(
gatherWithTimeout(shutdown, input, acc, interval) gatherWithTimeout(shutdown, input, acc, interval)
elapsed := time.Since(start) elapsed := time.Since(start)
log.Printf("D! Input [%s] gathered metrics, (%s interval) in %s\n", log.Printf("D! Input [%s] gathered metrics, (%s interval) in %s\n",
input.Name(), interval, elapsed) input.Name(), interval, elapsed)
@ -366,9 +365,7 @@ func (a *Agent) Run(shutdown chan struct{}) error {
} }
go func(in *models.RunningInput, interv time.Duration) { go func(in *models.RunningInput, interv time.Duration) {
defer wg.Done() defer wg.Done()
if err := a.gatherer(shutdown, in, interv, metricC); err != nil { a.gatherer(shutdown, in, interv, metricC)
log.Printf("E! " + err.Error())
}
}(input, interval) }(input, interval)
} }

View File

@ -12,8 +12,8 @@ import (
"github.com/influxdata/telegraf/agent" "github.com/influxdata/telegraf/agent"
"github.com/influxdata/telegraf/internal/config" "github.com/influxdata/telegraf/internal/config"
_ "github.com/influxdata/telegraf/plugins/aggregators/all"
"github.com/influxdata/telegraf/logger" "github.com/influxdata/telegraf/logger"
_ "github.com/influxdata/telegraf/plugins/aggregators/all"
"github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/inputs"
_ "github.com/influxdata/telegraf/plugins/inputs/all" _ "github.com/influxdata/telegraf/plugins/inputs/all"
"github.com/influxdata/telegraf/plugins/outputs" "github.com/influxdata/telegraf/plugins/outputs"
@ -112,8 +112,6 @@ Examples:
telegraf -config telegraf.conf -input-filter cpu:mem -output-filter influxdb telegraf -config telegraf.conf -input-filter cpu:mem -output-filter influxdb
` `
var logger service.Logger
var stop chan struct{} var stop chan struct{}
var srvc service.Service var srvc service.Service
@ -309,10 +307,6 @@ func main() {
if err != nil { if err != nil {
log.Fatal(err) 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 // Handle the -service flag here to prevent any issues with tooling that
// may not have an interactive session, e.g. installing from Ansible. // may not have an interactive session, e.g. installing from Ansible.
if *fService != "" { if *fService != "" {