Documentation ¶
Index ¶
- func GetLocalHost() string
- func MockBatchPoints() client.BatchPoints
- func TestPoint(value interface{}, name ...string) *client.Point
- type Accumulator
- func (a *Accumulator) Add(measurement string, value interface{}, tags map[string]string, t ...time.Time)
- func (a *Accumulator) AddDefaultTag(key, value string)
- func (a *Accumulator) AddFields(measurement string, fields map[string]interface{}, tags map[string]string, ...)
- func (a *Accumulator) AssertContainsFields(t *testing.T, measurement string, fields map[string]interface{})
- func (a *Accumulator) AssertContainsTaggedFields(t *testing.T, measurement string, fields map[string]interface{}, ...)
- func (a *Accumulator) Debug() bool
- func (a *Accumulator) Get(measurement string) (*Point, bool)
- func (a *Accumulator) HasFloatField(measurement string, field string) bool
- func (a *Accumulator) HasIntField(measurement string, field string) bool
- func (a *Accumulator) HasMeasurement(measurement string) bool
- func (a *Accumulator) HasUIntField(measurement string, field string) bool
- func (a *Accumulator) NFields() int
- func (a *Accumulator) Prefix() string
- func (a *Accumulator) SetDebug(debug bool)
- func (a *Accumulator) SetDefaultTags(tags map[string]string)
- func (a *Accumulator) SetPrefix(prefix string)
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalHost ¶ added in v0.1.4
func GetLocalHost() string
GetLocalHost returns the DOCKER_HOST environment variable, parsing out any scheme or ports so that only the IP address is returned.
func MockBatchPoints ¶ added in v0.1.7
func MockBatchPoints() client.BatchPoints
MockBatchPoints returns a mock BatchPoints object for using in unit tests of telegraf output sinks.
Types ¶
type Accumulator ¶
Accumulator defines a mocked out accumulator
func (*Accumulator) Add ¶
func (a *Accumulator) Add( measurement string, value interface{}, tags map[string]string, t ...time.Time, )
Add adds a measurement point to the accumulator
func (*Accumulator) AddDefaultTag ¶ added in v0.2.0
func (a *Accumulator) AddDefaultTag(key, value string)
func (*Accumulator) AddFields ¶ added in v0.2.0
func (a *Accumulator) AddFields( measurement string, fields map[string]interface{}, tags map[string]string, timestamp ...time.Time, )
AddFields adds a measurement point with a specified timestamp.
func (*Accumulator) AssertContainsFields ¶ added in v0.10.0
func (a *Accumulator) AssertContainsFields( t *testing.T, measurement string, fields map[string]interface{}, )
func (*Accumulator) AssertContainsTaggedFields ¶ added in v0.10.0
func (*Accumulator) Debug ¶ added in v0.2.0
func (a *Accumulator) Debug() bool
func (*Accumulator) Get ¶
func (a *Accumulator) Get(measurement string) (*Point, bool)
Get gets the specified measurement point from the accumulator
func (*Accumulator) HasFloatField ¶ added in v0.10.0
func (a *Accumulator) HasFloatField(measurement string, field string) bool
HasFloatValue returns true if the given measurement has a float value
func (*Accumulator) HasIntField ¶ added in v0.10.0
func (a *Accumulator) HasIntField(measurement string, field string) bool
HasIntValue returns true if the measurement has an Int value
func (*Accumulator) HasMeasurement ¶ added in v0.1.8
func (a *Accumulator) HasMeasurement(measurement string) bool
HasMeasurement returns true if the accumulator has a measurement with the given name
func (*Accumulator) HasUIntField ¶ added in v0.10.0
func (a *Accumulator) HasUIntField(measurement string, field string) bool
HasUIntValue returns true if the measurement has a UInt value
func (*Accumulator) NFields ¶ added in v0.10.0
func (a *Accumulator) NFields() int
NFields returns the total number of fields in the accumulator, across all measurements
func (*Accumulator) Prefix ¶ added in v0.2.0
func (a *Accumulator) Prefix() string
func (*Accumulator) SetDebug ¶ added in v0.2.0
func (a *Accumulator) SetDebug(debug bool)
func (*Accumulator) SetDefaultTags ¶ added in v0.2.0
func (a *Accumulator) SetDefaultTags(tags map[string]string)
func (*Accumulator) SetPrefix ¶ added in v0.2.0
func (a *Accumulator) SetPrefix(prefix string)