Allow floats in valuecounter aggregator (#5168)

This commit is contained in:
Daniel Nelson
2018-12-26 19:39:34 -08:00
committed by GitHub
parent c72d8a1663
commit dbe6f594a9
3 changed files with 5 additions and 14 deletions

View File

@@ -2,7 +2,6 @@ package valuecounter
import (
"fmt"
"log"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/aggregators"
@@ -68,14 +67,6 @@ func (vc *ValueCounter) Add(in telegraf.Metric) {
for fk, fv := range in.Fields() {
for _, cf := range vc.Fields {
if fk == cf {
// Do not process float types to prevent memory from blowing up
switch fv.(type) {
default:
log.Printf("I! Valuecounter: Unsupported field type. " +
"Must be an int, string or bool. Ignoring.")
continue
case uint64, int64, string, bool:
}
fn := fmt.Sprintf("%v_%v", fk, fv)
vc.cache[id].fieldCount[fn]++
}