Documentation ¶
Index ¶
- func TimeWithPrecision(t time.Time, precision time.Duration) time.Time
- type Accumulator
- func (ac *Accumulator) AddError(err error)
- func (ac *Accumulator) AddFields(measurement string, fields map[string]interface{}, tags map[string]string, ...)
- func (ac *Accumulator) AddMetric(m Metric)
- func (ac *Accumulator) SetPrecision(precision time.Duration)
- func (ac *Accumulator) WithErrorWriter(errfile io.Writer) *Accumulator
- type BytesFormat
- type Field
- type Metric
- func (m *Metric) AddField(key string, value interface{})
- func (m *Metric) AddPrefix(prefix string)
- func (m *Metric) AddSuffix(suffix string)
- func (m *Metric) AddTag(key, value string)
- func (m *Metric) Bytes(format BytesFormat) []byte
- func (m *Metric) Copy() Metric
- func (m *Metric) Field(key string) interface{}
- func (m *Metric) FieldList() []*Field
- func (m *Metric) Fields() map[string]interface{}
- func (m *Metric) GetField(key string) (interface{}, bool)
- func (m *Metric) GetTag(key string) (string, bool)
- func (m *Metric) HasField(key string) bool
- func (m *Metric) HasTag(key string) bool
- func (m *Metric) HashID() uint64
- func (m *Metric) Name() string
- func (m *Metric) RemoveField(key string)
- func (m *Metric) RemoveTag(key string)
- func (m *Metric) SetName(name string)
- func (m *Metric) SetTime(t time.Time)
- func (m *Metric) String(format BytesFormat) string
- func (m *Metric) Tag(key string) string
- func (m *Metric) TagList() []*Tag
- func (m *Metric) Tags() map[string]string
- func (m *Metric) Time() time.Time
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶
func NewAccumulator( pluginname string, metrics chan<- Metric, ) *Accumulator
NewAccumulator returns a new Accumulator instance
func (*Accumulator) AddError ¶
func (ac *Accumulator) AddError(err error)
AddError passes a runtime error to the Accumulator. The error will be tagged with the plugin name and written to the log.
func (*Accumulator) AddMetric ¶
func (ac *Accumulator) AddMetric(m Metric)
func (*Accumulator) SetPrecision ¶
func (ac *Accumulator) SetPrecision(precision time.Duration)
func (*Accumulator) WithErrorWriter ¶
func (ac *Accumulator) WithErrorWriter(errfile io.Writer) *Accumulator
type BytesFormat ¶
type BytesFormat uint8
BytesFormat represents supported decode formats
const ( Go BytesFormat = iota InfluxLp )
type Field ¶
type Field struct { Key string Value interface{} }
Field represents a single field key and value.
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func FromMetric ¶
FromMetric returns a deep copy of the metric with any tracking information removed.
func (*Metric) Bytes ¶
func (m *Metric) Bytes(format BytesFormat) []byte
String returns a []byte representation of the metric in the given format
(https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md)
Currently it only supports influx line protocol
func (*Metric) RemoveField ¶
func (*Metric) String ¶
func (m *Metric) String(format BytesFormat) string
String returns a string representation of the metric in the given format
Click to show internal directories.
Click to hide internal directories.