提交 0c22f9d8 编写于 作者: X xieyinglin

replace grafana subscribe sql

上级 848ad482
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"editable": true, "editable": true,
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"id": 4, "id": 7,
"links": [], "links": [],
"panels": [ "panels": [
{ {
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
{ {
"alias": "lastest_temperature", "alias": "lastest_temperature",
"refId": "A", "refId": "A",
"sql": "select last(temperature) from test.s_sensor_info where location = 'beijing' and ts > now - 1h and ts < now interval(1m)", "sql": "select ts, temp from test.stream_temp_last where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
} }
...@@ -116,9 +116,10 @@ ...@@ -116,9 +116,10 @@
"options": { "options": {
"fieldOptions": { "fieldOptions": {
"calcs": [ "calcs": [
"mean" "last"
], ],
"defaults": { "defaults": {
"decimals": 2,
"mappings": [], "mappings": [],
"max": 100, "max": 100,
"min": 0, "min": 0,
...@@ -146,7 +147,7 @@ ...@@ -146,7 +147,7 @@
{ {
"alias": "maxHumidity", "alias": "maxHumidity",
"refId": "A", "refId": "A",
"sql": "select max(humidity) from test.s_sensor_info where location = 'beijing' and ts > now -1h and ts < now", "sql": "select ts, humidity from test.stream_humidity_max where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
} }
...@@ -198,7 +199,7 @@ ...@@ -198,7 +199,7 @@
{ {
"alias": "avgTemperature", "alias": "avgTemperature",
"refId": "A", "refId": "A",
"sql": "select avg(temperature) from test.s_sensor_info where location = 'beijing' and ts > now -1h and ts < now interval(1m)", "sql": "select ts, temp from test.stream_temp_avg where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
} }
...@@ -284,23 +285,23 @@ ...@@ -284,23 +285,23 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"alias": "avg", "alias": "max",
"refId": "A", "refId": "A",
"sql": "select max(temperature) from test.t_0_sensor_info where ts > now -1h and ts < now interval(1m)", "sql": "select ts, max_temp from test.stream_sensor where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
}, },
{ {
"alias": "max", "alias": "avg",
"refId": "B", "refId": "B",
"sql": "select avg(temperature) from test.t_0_sensor_info where ts > now -1h and ts < now interval(1m)", "sql": "select ts, avg_temp from test.stream_sensor where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
}, },
{ {
"alias": "min", "alias": "min",
"refId": "C", "refId": "C",
"sql": "select min(temperature) from test.t_0_sensor_info where ts > now -1h and ts < now interval(1m)", "sql": "select ts, min_temp from test.stream_sensor where ts >= $from and ts < $to",
"target": "select metric", "target": "select metric",
"type": "timeserie" "type": "timeserie"
} }
...@@ -355,7 +356,7 @@ ...@@ -355,7 +356,7 @@
"list": [] "list": []
}, },
"time": { "time": {
"from": "now-1h", "from": "now-5m",
"to": "now" "to": "now"
}, },
"timepicker": { "timepicker": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册