summaryrefslogtreecommitdiff
path: root/influxdb.go
blob: 7dd42bb6893a3be4c4c5e56655115fb6349b51fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"time"

	client "github.com/influxdata/influxdb/client/v2"
)

// Point is a datapoint to be logged in to InfluxDB.
type Point = *client.Point

// NewPoint is a convenience function to create a new Point.
func NewPoint(name string, tags map[string]string, fields map[string]interface{}) Point {
	pt, err := client.NewPoint(name, tags, fields, time.Now())
	if err != nil {
		panic(err)
	}
	return pt
}