From 694955c87bde9320148544783936947ae337272e Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Fri, 3 Feb 2017 16:41:45 +0000 Subject: [PATCH] Remove metric.Point from metric interface --- Godeps | 1 - metric.go | 7 ------- metric/metric.go | 8 -------- metric/metric_test.go | 20 -------------------- 4 files changed, 36 deletions(-) diff --git a/Godeps b/Godeps index 5443c1039..d2293e142 100644 --- a/Godeps +++ b/Godeps @@ -26,7 +26,6 @@ github.com/hailocab/go-hostpool e80d13ce29ede4452c43dea11e79b9bc8a15b478 github.com/hashicorp/consul 63d2fc68239b996096a1c55a0d4b400ea4c2583f github.com/hpcloud/tail 915e5feba042395f5fda4dbe9c0e99aeab3088b3 github.com/influxdata/config 8ec4638a81500c20be24855812bc8498ebe2dc92 -github.com/influxdata/influxdb 2fe8ed308439a98a9b01943939b44048ed952c90 github.com/influxdata/toml ad49a5c2936f96b8f5943c3fdba47630ccf45a0d github.com/influxdata/wlog 7c63b0a71ef8300adc255344d275e10e5c3a71ec github.com/jackc/pgx c8080fc4a1bfa44bf90383ad0fdce2f68b7d313c diff --git a/metric.go b/metric.go index b1ab1b29f..fc479b51d 100644 --- a/metric.go +++ b/metric.go @@ -2,9 +2,6 @@ package telegraf import ( "time" - - // TODO remove - "github.com/influxdata/influxdb/client/v2" ) // ValueType is an enumeration of metric types that represent a simple value. @@ -62,8 +59,4 @@ type Metric interface { // aggregator things: SetAggregate(bool) IsAggregate() bool - - // Point returns a influxdb client.Point object - // TODO remove this function - Point() *client.Point } diff --git a/metric/metric.go b/metric/metric.go index 936d0907e..0a2ca41b6 100644 --- a/metric/metric.go +++ b/metric/metric.go @@ -9,9 +9,6 @@ import ( "time" "github.com/influxdata/telegraf" - - // TODO remove - "github.com/influxdata/influxdb/client/v2" ) const MaxInt = int(^uint(0) >> 1) @@ -137,11 +134,6 @@ type metric struct { nsec int64 } -func (m *metric) Point() *client.Point { - c, _ := client.NewPoint(m.Name(), m.Tags(), m.Fields(), m.Time()) - return c -} - func (m *metric) String() string { return string(m.name) + string(m.tags) + " " + string(m.fields) + " " + string(m.t) + "\n" } diff --git a/metric/metric_test.go b/metric/metric_test.go index 65b4b0fba..f133a507c 100644 --- a/metric/metric_test.go +++ b/metric/metric_test.go @@ -595,26 +595,6 @@ func TestNewMetricAggregate(t *testing.T) { assert.True(t, m.IsAggregate()) } -func TestNewMetricPoint(t *testing.T) { - now := time.Now() - - tags := map[string]string{ - "host": "localhost", - } - fields := map[string]interface{}{ - "usage_idle": float64(99), - } - m, err := New("cpu", tags, fields, now) - assert.NoError(t, err) - - p := m.Point() - pfields, _ := p.Fields() - - assert.Equal(t, fields, m.Fields()) - assert.Equal(t, fields, pfields) - assert.Equal(t, "cpu", p.Name()) -} - func TestNewMetricString(t *testing.T) { now := time.Now()