MCPcopy
hub / github.com/influxdata/telegraf / Serializer

Interface Serializer

serializer.go:8–21  ·  view source on GitHub ↗

Serializer is an interface defining functions that a serializer plugin must satisfy. Implementations of this interface should be reentrant but are not required to be thread-safe.

Source from the content-addressed store, hash-verified

6// Implementations of this interface should be reentrant but are not required
7// to be thread-safe.
8type Serializer interface {
9 // Serialize takes a single telegraf metric and turns it into a byte buffer.
10 // separate metrics should be separated by a newline, and there should be
11 // a newline at the end of the buffer.
12 //
13 // New plugins should use SerializeBatch instead to allow for non-line
14 // delimited metrics.
15 Serialize(metric Metric) ([]byte, error)
16
17 // SerializeBatch takes an array of telegraf metric and serializes it into
18 // a byte buffer. This method is not required to be suitable for use with
19 // line oriented framing.
20 SerializeBatch(metrics []Metric) ([]byte, error)
21}
22
23// SerializerFunc is a function to create a new instance of a serializer
24type SerializerFunc func() (Serializer, error)

Callers 209

PrintMetricsFunction · 0.95
TestSerializeMetricFloatFunction · 0.95
TestSerializeMetricIntFunction · 0.95
TestSerializeMetricBoolFunction · 0.95
BenchmarkSerializeFunction · 0.95
TestSerializeBatchFunction · 0.95
TestSerializeMultiFunction · 0.95
TestSerializeBatchHecFunction · 0.95

Implementers 15

Serializerplugins/serializers/splunkmetric/splun
Serializerplugins/serializers/prometheus/prometh
Serializerplugins/serializers/nowmetric/nowmetri
Serializerplugins/serializers/prometheusremotewr
Serializerplugins/serializers/carbon2/carbon2.go
Serializerplugins/serializers/influx/influx.go
Serializerplugins/serializers/graphite/graphite.
Serializerplugins/serializers/cloudevents/cloude
Serializerplugins/serializers/template/template.
Serializerplugins/serializers/wavefront/wavefron
Serializerplugins/serializers/json/json.go
Serializerplugins/serializers/binary/binary.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…