Use an internal 'Metric' data type for telegraf metrics

As of now, this is pretty much just a wrapper around client.Point, but
this gives latitude to expand functionality more easily.

closes #564
This commit is contained in:
Cameron Sparr
2016-01-22 17:21:57 -07:00
parent 16540e35f1
commit 2df8dd6dbd
4 changed files with 185 additions and 0 deletions

18
models/accumulator.go Normal file
View File

@@ -0,0 +1,18 @@
package models
import "time"
type Accumulator interface {
// Create a point with a value, decorating it with tags
// NOTE: tags is expected to be owned by the caller, don't mutate
// it after passing to Add.
Add(measurement string,
value interface{},
tags map[string]string,
t ...time.Time)
AddFields(measurement string,
fields map[string]interface{},
tags map[string]string,
t ...time.Time)
}