Only log the overwritten metric warning on 1st overwrite per buffer

see #807
This commit is contained in:
Cameron Sparr 2016-03-09 14:44:32 +01:00
parent 805db7ca50
commit 845abcdd77
1 changed files with 5 additions and 3 deletions

View File

@ -82,9 +82,11 @@ func (ro *RunningOutput) AddMetric(metric telegraf.Metric) {
} }
} }
} else { } else {
log.Printf("WARNING: overwriting cached metrics, you may want to " + if ro.overwriteI == 0 {
"increase the metric_buffer_limit setting in your [agent] " + log.Printf("WARNING: overwriting cached metrics, you may want to " +
"config if you do not wish to overwrite metrics.\n") "increase the metric_buffer_limit setting in your [agent] " +
"config if you do not wish to overwrite metrics.\n")
}
if ro.overwriteI == len(ro.metrics) { if ro.overwriteI == len(ro.metrics) {
ro.overwriteI = 0 ro.overwriteI = 0
} }