Documentation ¶
Index ¶
- type MessagePackTime
- func (z *MessagePackTime) DecodeMsg(dc *msgp.Reader) (err error)
- func (z MessagePackTime) EncodeMsg(en *msgp.Writer) (err error)
- func (*MessagePackTime) ExtensionType() int8
- func (z *MessagePackTime) Len() int
- func (z *MessagePackTime) MarshalBinaryTo(buf []byte) error
- func (z MessagePackTime) MarshalMsg(b []byte) (o []byte, err error)
- func (z MessagePackTime) Msgsize() (s int)
- func (z *MessagePackTime) UnmarshalBinary(buf []byte) error
- func (z *MessagePackTime) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Metric
- type Serializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessagePackTime ¶
type MessagePackTime struct {
// contains filtered or unexported fields
}
MessagePackTime implements the official timestamp extension type https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type
tinylib/msgp has been using their own custom extension type and the official extension is not available. (https://github.com/tinylib/msgp/issues/214)
func (*MessagePackTime) DecodeMsg ¶
func (z *MessagePackTime) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (MessagePackTime) EncodeMsg ¶
func (z MessagePackTime) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MessagePackTime) ExtensionType ¶
func (*MessagePackTime) ExtensionType() int8
ExtensionType implements the Extension interface
func (*MessagePackTime) Len ¶
func (z *MessagePackTime) Len() int
Len implements the Extension interface The timestamp extension uses variable length encoding depending the input
32bits: [1970-01-01 00:00:00 UTC, 2106-02-07 06:28:16 UTC) range. If the nanoseconds part is 0 64bits: [1970-01-01 00:00:00.000000000 UTC, 2514-05-30 01:53:04.000000000 UTC) range. 96bits: [-584554047284-02-23 16:59:44 UTC, 584554051223-11-09 07:00:16.000000000 UTC) range.
func (*MessagePackTime) MarshalBinaryTo ¶
func (z *MessagePackTime) MarshalBinaryTo(buf []byte) error
MarshalBinaryTo implements the Extension interface
func (MessagePackTime) MarshalMsg ¶
func (z MessagePackTime) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (MessagePackTime) Msgsize ¶
func (z MessagePackTime) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MessagePackTime) UnmarshalBinary ¶
func (z *MessagePackTime) UnmarshalBinary(buf []byte) error
UnmarshalBinary implements the Extension interface
func (*MessagePackTime) UnmarshalMsg ¶
func (z *MessagePackTime) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Metric ¶
type Metric struct { Name string `msg:"name"` Time MessagePackTime `msg:"time,extension"` Tags map[string]string `msg:"tags"` Fields map[string]interface{} `msg:"fields"` }
Metric is structure to define MessagePack message format will be used by msgp code generator
func (*Metric) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Serializer ¶
type Serializer struct{}
Serializer encodes metrics in MessagePack format
func (*Serializer) InitFromConfig ¶ added in v1.27.0
func (s *Serializer) InitFromConfig(_ *serializers.Config) error
InitFromConfig is a compatibility function to construct the parser the old way
func (*Serializer) Serialize ¶
func (s *Serializer) Serialize(metric telegraf.Metric) ([]byte, error)
Serialize implements serializers.Serializer.Serialize github.com/influxdata/telegraf/plugins/serializers/Serializer
func (*Serializer) SerializeBatch ¶
func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
SerializeBatch implements serializers.Serializer.SerializeBatch github.com/influxdata/telegraf/plugins/serializers/Serializer