You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TimeRange: tsdb.TimeRange{From: "1h", To: "now-1m"},
48
51
}
49
52
50
53
rawQuery, err:=builder.Build(query, queryContext)
51
54
So(err, ShouldBeNil)
52
-
So(rawQuery, ShouldEqual, `SELECT mean("value") FROM "cpu" WHERE "hostname" = 'server1' OR "hostname" = 'server2' AND time > now() - 5m GROUP BY time(10s)`)
55
+
So(rawQuery, ShouldEqual, `SELECT mean("value") FROM "cpu" WHERE "hostname" = 'server1' OR "hostname" = 'server2' AND time > now() - 1h and time < now() - 1m GROUP BY time(10s)`)
56
+
})
57
+
58
+
Convey("can render time range", func() {
59
+
Convey("render from: 2h to now-1h", func() {
60
+
query:=Query{TimeRange: tsdb.TimeRange{From: "2h", To: "now-1h"}}
61
+
So(renderTimeFilter(&query), ShouldEqual, "time > now() - 2h and time < now() - 1h")
0 commit comments