Throughout telegraf, use telegraf.Metric rather than client.Point
closes #599
This commit is contained in:
committed by
Ryan Merrick
parent
5364a20825
commit
1edfa9bbd0
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/influxdata/influxdb/client/v2"
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/plugins/inputs/prometheus"
|
||||
"github.com/influxdata/telegraf/testutil"
|
||||
)
|
||||
@@ -21,19 +21,19 @@ func TestPrometheusWritePointEmptyTag(t *testing.T) {
|
||||
Urls: []string{"http://localhost:9126/metrics"},
|
||||
}
|
||||
tags := make(map[string]string)
|
||||
pt1, _ := client.NewPoint(
|
||||
pt1, _ := telegraf.NewMetric(
|
||||
"test_point_1",
|
||||
tags,
|
||||
map[string]interface{}{"value": 0.0})
|
||||
pt2, _ := client.NewPoint(
|
||||
pt2, _ := telegraf.NewMetric(
|
||||
"test_point_2",
|
||||
tags,
|
||||
map[string]interface{}{"value": 1.0})
|
||||
var points = []*client.Point{
|
||||
var metrics = []telegraf.Metric{
|
||||
pt1,
|
||||
pt2,
|
||||
}
|
||||
require.NoError(t, pTesting.Write(points))
|
||||
require.NoError(t, pTesting.Write(metrics))
|
||||
|
||||
expected := []struct {
|
||||
name string
|
||||
@@ -63,19 +63,19 @@ func TestPrometheusWritePointTag(t *testing.T) {
|
||||
}
|
||||
tags := make(map[string]string)
|
||||
tags["testtag"] = "testvalue"
|
||||
pt1, _ := client.NewPoint(
|
||||
pt1, _ := telegraf.NewMetric(
|
||||
"test_point_3",
|
||||
tags,
|
||||
map[string]interface{}{"value": 0.0})
|
||||
pt2, _ := client.NewPoint(
|
||||
pt2, _ := telegraf.NewMetric(
|
||||
"test_point_4",
|
||||
tags,
|
||||
map[string]interface{}{"value": 1.0})
|
||||
var points = []*client.Point{
|
||||
var metrics = []telegraf.Metric{
|
||||
pt1,
|
||||
pt2,
|
||||
}
|
||||
require.NoError(t, pTesting.Write(points))
|
||||
require.NoError(t, pTesting.Write(metrics))
|
||||
|
||||
expected := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user