line_metric_encoder

package
v0.0.0-...-87313dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldBuilder

type FieldBuilder struct {
	// contains filtered or unexported fields
}

Field Builder

func (*FieldBuilder) Value

func (m *FieldBuilder) Value(value interface{}) *WrappedMetric

Emit a field

func (*FieldBuilder) ValueIfNoErr

func (m *FieldBuilder) ValueIfNoErr(value interface{}, err error) *WrappedMetric

Emit a field if err != nil

type MetricEncoder

type MetricEncoder struct {
	// contains filtered or unexported fields
}

A non-reentrant encoder that can be called multiple times

func NewMetricEncoder

func NewMetricEncoder() *MetricEncoder

Create a metric encoder (called by the when it needs a new instance)

func (*MetricEncoder) Encode

func (enc *MetricEncoder) Encode(m protocol.Metric) []byte

Encode a metric to bytes

func (*MetricEncoder) Write

func (enc *MetricEncoder) Write(m protocol.Metric, writer io.Writer) (int, error)

Encode metric and write to an io.Writer

type MetricEncoderPool

type MetricEncoderPool struct {
	// contains filtered or unexported fields
}

func NewMetricEncoderPool

func NewMetricEncoderPool() *MetricEncoderPool

func (*MetricEncoderPool) Get

func (m *MetricEncoderPool) Get() *MetricEncoder

func (*MetricEncoderPool) NewMetric

func (enc *MetricEncoderPool) NewMetric(metricName string) *WrappedMetric

Create a new metric attached to this encoder pool

func (*MetricEncoderPool) PutBack

func (m *MetricEncoderPool) PutBack(encoder interface{})

type TagBuilder

type TagBuilder struct {
	// contains filtered or unexported fields
}

Tag Builder

func (*TagBuilder) Value

func (m *TagBuilder) Value(value string) *WrappedMetric

Emit a tag

func (*TagBuilder) ValueIfNoErr

func (m *TagBuilder) ValueIfNoErr(value string, err error) *WrappedMetric

Emit a tag if err != nil

type WrappedMetric

type WrappedMetric struct {
	protocol.MutableMetric
	// contains filtered or unexported fields
}

func (*WrappedMetric) BuildField

func (wrapped *WrappedMetric) BuildField(key string) *FieldBuilder

Create a field builder

func (*WrappedMetric) BuildTag

func (w *WrappedMetric) BuildTag(key string) *TagBuilder

Create a tag builder

func (*WrappedMetric) Encode

func (m *WrappedMetric) Encode() []byte

func (*WrappedMetric) Print

func (m *WrappedMetric) Print() (int, error)

func (*WrappedMetric) WithField

func (m *WrappedMetric) WithField(key string, value interface{}) *WrappedMetric

func (*WrappedMetric) WithTag

func (m *WrappedMetric) WithTag(key string, value string) *WrappedMetric

func (*WrappedMetric) WithTime

func (m *WrappedMetric) WithTime(tm time.Time) *WrappedMetric

func (*WrappedMetric) Write

func (m *WrappedMetric) Write(out io.Writer) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL