From 4d8d2a9690e3694dac65fd944b36d806b99cf32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ander=20Argui=C3=B1ano?= Date: Thu, 3 Jan 2019 20:40:17 +0100 Subject: [PATCH] Renamed unixEpochFilterNano to unixEpochNanoFilter --- pkg/tsdb/postgres/macros.go | 2 +- pkg/tsdb/postgres/macros_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/tsdb/postgres/macros.go b/pkg/tsdb/postgres/macros.go index 7f50f8269ca..3af43dfcf3e 100644 --- a/pkg/tsdb/postgres/macros.go +++ b/pkg/tsdb/postgres/macros.go @@ -122,7 +122,7 @@ func (m *postgresMacroEngine) evaluateMacro(name string, args []string) (string, return "", fmt.Errorf("missing time column argument for macro %v", name) } return fmt.Sprintf("%s >= %d AND %s <= %d", args[0], m.timeRange.GetFromAsSecondsEpoch(), args[0], m.timeRange.GetToAsSecondsEpoch()), nil - case "__unixEpochFilterNano": + case "__unixEpochNanoFilter": if len(args) == 0 { return "", fmt.Errorf("missing time column argument for macro %v", name) } diff --git a/pkg/tsdb/postgres/macros_test.go b/pkg/tsdb/postgres/macros_test.go index 0ec49bedb21..6334a3b5239 100644 --- a/pkg/tsdb/postgres/macros_test.go +++ b/pkg/tsdb/postgres/macros_test.go @@ -115,8 +115,8 @@ func TestMacroEngine(t *testing.T) { So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.Unix(), to.Unix())) }) - Convey("interpolate __unixEpochFilterNano function", func() { - sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochFilterNano(time)") + Convey("interpolate __unixEpochNanoFilter function", func() { + sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochNanoFilter(time)") So(err, ShouldBeNil) So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.UnixNano(), to.UnixNano())) @@ -153,8 +153,8 @@ func TestMacroEngine(t *testing.T) { So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.Unix(), to.Unix())) }) - Convey("interpolate __unixEpochFilterNano function", func() { - sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochFilterNano(time)") + Convey("interpolate __unixEpochNanoFilter function", func() { + sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochNanoFilter(time)") So(err, ShouldBeNil) So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.UnixNano(), to.UnixNano())) @@ -179,8 +179,8 @@ func TestMacroEngine(t *testing.T) { So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.Unix(), to.Unix())) }) - Convey("interpolate __unixEpochFilterNano function", func() { - sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochFilterNano(time)") + Convey("interpolate __unixEpochNanoFilter function", func() { + sql, err := engine.Interpolate(query, timeRange, "select $__unixEpochNanoFilter(time)") So(err, ShouldBeNil) So(sql, ShouldEqual, fmt.Sprintf("select time >= %d AND time <= %d", from.UnixNano(), to.UnixNano()))