Switch plugin API to use an accumulator
This commit is contained in:
17
accumulator.go
Normal file
17
accumulator.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package tivan
|
||||
|
||||
import "github.com/influxdb/influxdb/client"
|
||||
|
||||
type BatchPoints struct {
|
||||
client.BatchPoints
|
||||
}
|
||||
|
||||
func (bp *BatchPoints) Add(name string, val interface{}, tags map[string]string) {
|
||||
bp.Points = append(bp.Points, client.Point{
|
||||
Name: name,
|
||||
Tags: tags,
|
||||
Fields: map[string]interface{}{
|
||||
"value": val,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user