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 committed by Michele Fadda
parent 41e2c7f6da
commit 17d45adcaa
1 changed files with 5 additions and 3 deletions

View File

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