mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
change fillmode from last to previous
This commit is contained in:
@@ -102,8 +102,8 @@ func (m *msSqlMacroEngine) evaluateMacro(name string, args []string) (string, er
|
||||
switch args[2] {
|
||||
case "NULL":
|
||||
m.query.Model.Set("fillMode", "null")
|
||||
case "last":
|
||||
m.query.Model.Set("fillMode", "last")
|
||||
case "previous":
|
||||
m.query.Model.Set("fillMode", "previous")
|
||||
default:
|
||||
m.query.Model.Set("fillMode", "value")
|
||||
floatVal, err := strconv.ParseFloat(args[2], 64)
|
||||
|
||||
@@ -85,8 +85,8 @@ func TestMacroEngine(t *testing.T) {
|
||||
So(fillInterval, ShouldEqual, 5*time.Minute.Seconds())
|
||||
})
|
||||
|
||||
Convey("interpolate __timeGroup function with fill (value = last)", func() {
|
||||
_, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column,'5m', last)")
|
||||
Convey("interpolate __timeGroup function with fill (value = previous)", func() {
|
||||
_, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column,'5m', previous)")
|
||||
|
||||
fill := query.Model.Get("fill").MustBool()
|
||||
fillMode := query.Model.Get("fillMode").MustString()
|
||||
@@ -94,7 +94,7 @@ func TestMacroEngine(t *testing.T) {
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
So(fill, ShouldBeTrue)
|
||||
So(fillMode, ShouldEqual, "last")
|
||||
So(fillMode, ShouldEqual, "previous")
|
||||
So(fillInterval, ShouldEqual, 5*time.Minute.Seconds())
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user