Effective unit costs

This commit is contained in:
Stephen Newey
2018-11-11 10:06:59 +00:00
parent c197367916
commit 39637c7d39
2 changed files with 235 additions and 5 deletions

View File

@@ -132,6 +132,8 @@
"measurement": "electricity", "measurement": "electricity",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"consumption\") FROM \"electricity\" WHERE $timeFilter",
"rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
"select": [ "select": [
@@ -243,7 +245,7 @@
"measurement": "electricity", "measurement": "electricity",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"cost\")/100 FROM \"electricity\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "query": "SELECT sum(\"cost\")/100 FROM \"electricity\" WHERE $timeFilter",
"rawQuery": true, "rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
@@ -356,7 +358,7 @@
"measurement": "electricity", "measurement": "electricity",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"total_cost\")/100 FROM \"electricity\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "query": "SELECT sum(\"total_cost\")/100 FROM \"electricity\" WHERE $timeFilter",
"rawQuery": true, "rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
@@ -390,6 +392,119 @@
], ],
"valueName": "total" "valueName": "total"
}, },
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "${DS_INFLUX}",
"decimals": 4,
"format": "currencyGBP",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 6,
"x": 18,
"y": 0
},
"id": 14,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "electricity",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (sum(\"total_cost\") / sum(\"consumption\"))/100 FROM \"electricity\" WHERE $timeFilter",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"cost"
],
"type": "field"
},
{
"params": [],
"type": "sum"
}
]
],
"tags": []
}
],
"thresholds": "",
"title": "Electricity effective unit cost",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "total"
},
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
@@ -634,6 +749,8 @@
"measurement": "gas", "measurement": "gas",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"consumption\") FROM \"gas\" WHERE $timeFilter",
"rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
"select": [ "select": [
@@ -745,7 +862,7 @@
"measurement": "electricity", "measurement": "electricity",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"cost\")/100 FROM \"gas\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "query": "SELECT sum(\"cost\")/100 FROM \"gas\" WHERE $timeFilter",
"rawQuery": true, "rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
@@ -858,7 +975,7 @@
"measurement": "electricity", "measurement": "electricity",
"orderByTime": "ASC", "orderByTime": "ASC",
"policy": "default", "policy": "default",
"query": "SELECT sum(\"total_cost\")/100 FROM \"gas\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "query": "SELECT sum(\"total_cost\")/100 FROM \"gas\" WHERE $timeFilter",
"rawQuery": true, "rawQuery": true,
"refId": "A", "refId": "A",
"resultFormat": "time_series", "resultFormat": "time_series",
@@ -892,6 +1009,119 @@
], ],
"valueName": "total" "valueName": "total"
}, },
{
"cacheTimeout": null,
"colorBackground": false,
"colorValue": false,
"colors": [
"#299c46",
"rgba(237, 129, 40, 0.89)",
"#d44a3a"
],
"datasource": "${DS_INFLUX}",
"decimals": 4,
"format": "currencyGBP",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"gridPos": {
"h": 2,
"w": 6,
"x": 18,
"y": 11
},
"id": 15,
"interval": null,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"tableColumn": "",
"targets": [
{
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "electricity",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (sum(\"total_cost\") / sum(\"consumption\"))/100 FROM \"gas\" WHERE $timeFilter",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"cost"
],
"type": "field"
},
{
"params": [],
"type": "sum"
}
]
],
"tags": []
}
],
"thresholds": "",
"title": "Gas effective unit cost",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "total"
},
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
@@ -1098,5 +1328,5 @@
"timezone": "", "timezone": "",
"title": "Energy usage", "title": "Energy usage",
"uid": "7Nqpoj-ik", "uid": "7Nqpoj-ik",
"version": 8 "version": 11
} }