Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromMetric ¶
FromMetric returns a deep copy of the metric with any tracking information removed.
Types ¶
type SeriesGrouper ¶
type SeriesGrouper struct {
// contains filtered or unexported fields
}
func NewSeriesGrouper ¶
func NewSeriesGrouper() *SeriesGrouper
NewSeriesGrouper returns a type that can be used to group fields by series and time, so that fields which share these values will be combined into a single telegraf.Metric.
This is useful to build telegraf.Metric's when all fields for a series are not available at once.
ex: - cpu,host=localhost usage_time=42 - cpu,host=localhost idle_time=42 + cpu,host=localhost idle_time=42,usage_time=42
func (*SeriesGrouper) Add ¶
func (g *SeriesGrouper) Add( measurement string, tags map[string]string, tm time.Time, field string, fieldValue interface{}, )
Add adds a field key and value to the series.
func (*SeriesGrouper) AddMetric ¶
func (g *SeriesGrouper) AddMetric( metric types.Metric, )
AddMetric adds a metric to the series, merging with any previous matching metrics.
func (*SeriesGrouper) Metrics ¶
func (g *SeriesGrouper) Metrics() []types.Metric
Metrics returns the metrics grouped by series and time.