From 460160cfa4917626c96f5c135c1b7e2c450d68f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 28 Sep 2016 08:08:46 +0200 Subject: [PATCH] feat(testdata): added test case for ms resolution data --- pkg/tsdb/testdata/scenarios.go | 5 +- .../testdata/dashboards/graph_last_1h.json | 127 ++++++++++++++---- public/app/plugins/app/testdata/plugin.json | 2 +- 3 files changed, 104 insertions(+), 30 deletions(-) diff --git a/pkg/tsdb/testdata/scenarios.go b/pkg/tsdb/testdata/scenarios.go index d54cbb05638..c7df7d7bffb 100644 --- a/pkg/tsdb/testdata/scenarios.go +++ b/pkg/tsdb/testdata/scenarios.go @@ -28,8 +28,8 @@ func init() { Name: "Random Walk", Handler: func(query *tsdb.Query, context *tsdb.QueryContext) *tsdb.QueryResult { - timeWalkerMs := context.TimeRange.MustGetFrom().Unix() * 1000 - to := context.TimeRange.MustGetTo().Unix() * 1000 + to := context.TimeRange.MustGetTo().UnixNano() / int64(time.Millisecond) + timeWalkerMs := context.TimeRange.MustGetFrom().UnixNano() / int64(time.Millisecond) series := newSeriesForQuery(query) @@ -81,7 +81,6 @@ func init() { return queryRes }, }) - } func registerScenario(scenario *Scenario) { diff --git a/public/app/plugins/app/testdata/dashboards/graph_last_1h.json b/public/app/plugins/app/testdata/dashboards/graph_last_1h.json index 4669bb8cd60..0cca7b6c331 100644 --- a/public/app/plugins/app/testdata/dashboards/graph_last_1h.json +++ b/public/app/plugins/app/testdata/dashboards/graph_last_1h.json @@ -1,5 +1,5 @@ { - "revision": 2, + "revision": 3, "title": "TestData - Graph Panel Last 1h", "tags": [ "grafana-test" @@ -35,6 +35,7 @@ }, "lines": true, "linewidth": 2, + "links": [], "nullPointMode": "connected", "percentage": false, "pointradius": 5, @@ -48,8 +49,8 @@ { "refId": "A", "scenario": "random_walk", - "target": "", - "scenarioId": "no_data_points" + "scenarioId": "no_data_points", + "target": "" } ], "thresholds": [], @@ -86,8 +87,7 @@ "min": null, "show": true } - ], - "links": [] + ] }, { "aliasColors": {}, @@ -109,6 +109,7 @@ }, "lines": true, "linewidth": 2, + "links": [], "nullPointMode": "connected", "percentage": false, "pointradius": 5, @@ -122,8 +123,8 @@ { "refId": "A", "scenario": "random_walk", - "target": "", - "scenarioId": "datapoints_outside_range" + "scenarioId": "datapoints_outside_range", + "target": "" } ], "thresholds": [], @@ -160,18 +161,8 @@ "min": null, "show": true } - ], - "links": [] - } - ], - "title": "New row" - }, - { - "title": "New row", - "height": "250px", - "editable": true, - "collapse": false, - "panels": [ + ] + }, { "aliasColors": {}, "bars": false, @@ -192,21 +183,22 @@ }, "lines": true, "linewidth": 2, + "links": [], "nullPointMode": "connected", "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], - "span": 8, + "span": 4, "stack": false, "steppedLine": false, "targets": [ { "refId": "A", "scenario": "random_walk", - "target": "", - "scenarioId": "random_walk" + "scenarioId": "random_walk", + "target": "" } ], "thresholds": [], @@ -243,14 +235,96 @@ "min": null, "show": true } - ], - "links": [] + ] } - ] + ], + "title": "New row" + }, + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "Grafana TestData", + "editable": true, + "error": false, + "fill": 1, + "id": 4, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 8, + "stack": false, + "steppedLine": false, + "targets": [ + { + "refId": "A", + "scenario": "random_walk", + "scenarioId": "random_walk", + "target": "" + } + ], + "thresholds": [], + "timeFrom": "5d", + "timeShift": null, + "title": "Millisecond res x-axis and tooltip", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "title": "New row" } ], "time": { - "from": "now-6h", + "from": "now-1h", "to": "now" }, "timepicker": { @@ -284,6 +358,7 @@ "annotations": { "list": [] }, + "refresh": false, "schemaVersion": 13, "version": 4, "links": [], diff --git a/public/app/plugins/app/testdata/plugin.json b/public/app/plugins/app/testdata/plugin.json index 47ab291409b..0bd65a0735d 100644 --- a/public/app/plugins/app/testdata/plugin.json +++ b/public/app/plugins/app/testdata/plugin.json @@ -9,7 +9,7 @@ "name": "Grafana Project", "url": "http://grafana.org" }, - "version": "1.0.5", + "version": "1.0.6", "updated": "2016-09-26" },