Implement telegraf's own full metric type
main reasons behind this: - make adding/removing tags cheap - make adding/removing fields cheap - make parsing cheaper - make parse -> decorate -> write out bytes metric flow much faster Refactor serializer to use byte buffer
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/metric"
|
||||
)
|
||||
|
||||
var localhost = "localhost"
|
||||
@@ -54,7 +55,7 @@ func TestMetric(value interface{}, name ...string) telegraf.Metric {
|
||||
measurement = name[0]
|
||||
}
|
||||
tags := map[string]string{"tag1": "value1"}
|
||||
pt, _ := telegraf.NewMetric(
|
||||
pt, _ := metric.New(
|
||||
measurement,
|
||||
tags,
|
||||
map[string]interface{}{"value": value},
|
||||
|
||||
Reference in New Issue
Block a user