Document that serializers are not thread-safe

This commit is contained in:
Daniel Nelson 2019-05-17 13:44:08 -07:00
parent dc75f7bd32
commit d25fa3ced3
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,6 @@ import (
"time" "time"
"github.com/influxdata/telegraf" "github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/serializers/carbon2" "github.com/influxdata/telegraf/plugins/serializers/carbon2"
"github.com/influxdata/telegraf/plugins/serializers/graphite" "github.com/influxdata/telegraf/plugins/serializers/graphite"
"github.com/influxdata/telegraf/plugins/serializers/influx" "github.com/influxdata/telegraf/plugins/serializers/influx"
@ -24,6 +23,9 @@ type SerializerOutput interface {
// Serializer is an interface defining functions that a serializer plugin must // Serializer is an interface defining functions that a serializer plugin must
// satisfy. // satisfy.
//
// Implementations of this interface should be reentrant but are not required
// to be thread-safe.
type Serializer interface { type Serializer interface {
// Serialize takes a single telegraf metric and turns it into a byte buffer. // Serialize takes a single telegraf metric and turns it into a byte buffer.
// separate metrics should be separated by a newline, and there should be // separate metrics should be separated by a newline, and there should be