From 33aeeb6d9c83a04e8ce1fe06c090bf5d4b6af4de Mon Sep 17 00:00:00 2001 From: Matthias Wirtz Date: Thu, 31 Oct 2024 16:25:57 +0100 Subject: [PATCH] perf-improvements & pg_stat_statements additions --- dashboards/ChargingCostsStats.json | 99 ++- dashboards/DatabaseDashboadInfo.json | 979 ++++++++++++++++++++++----- 2 files changed, 869 insertions(+), 209 deletions(-) diff --git a/dashboards/ChargingCostsStats.json b/dashboards/ChargingCostsStats.json index f9c5d92..fdf8805 100644 --- a/dashboards/ChargingCostsStats.json +++ b/dashboards/ChargingCostsStats.json @@ -11,7 +11,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.3.0" + "version": "11.0.6+security-01" }, { "type": "datasource", @@ -162,7 +162,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -252,7 +252,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -342,7 +342,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -432,7 +432,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -525,7 +525,7 @@ "sizing": "auto", "valueMode": "color" }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -664,11 +664,11 @@ "values": false }, "tooltip": { + "maxHeight": 600, "mode": "single", "sort": "none" } }, - "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -784,7 +784,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -900,7 +900,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1016,7 +1016,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1151,7 +1151,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1241,7 +1241,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1331,7 +1331,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1421,7 +1421,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1511,7 +1511,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1596,7 +1596,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1683,7 +1683,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1800,7 +1800,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -1917,7 +1917,7 @@ "textMode": "value", "wideLayout": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -2067,7 +2067,7 @@ }, "showHeader": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -2202,7 +2202,7 @@ }, "showHeader": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -2337,7 +2337,7 @@ }, "showHeader": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -2490,7 +2490,7 @@ }, "showHeader": true }, - "pluginVersion": "11.3.0", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { @@ -2562,8 +2562,7 @@ "mode": "percentage", "steps": [ { - "color": "red", - "value": null + "color": "red" }, { "color": "#EAB839", @@ -2636,8 +2635,7 @@ "mode": "percentage", "steps": [ { - "color": "super-light-orange", - "value": null + "color": "super-light-orange" }, { "color": "light-orange", @@ -2832,8 +2830,7 @@ "mode": "absolute", "steps": [ { - "color": "super-light-blue", - "value": null + "color": "super-light-blue" }, { "color": "super-light-green", @@ -3047,8 +3044,7 @@ "mode": "absolute", "steps": [ { - "color": "super-light-blue", - "value": null + "color": "super-light-blue" }, { "color": "super-light-green", @@ -3116,7 +3112,6 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "11.3.0", "targets": [ { "datasource": { @@ -3398,7 +3393,7 @@ } ], "refresh": "", - "schemaVersion": 40, + "schemaVersion": 39, "tags": [ "TeslamateCustomDashboards" ], @@ -3411,13 +3406,17 @@ "uid": "TeslaMate" }, "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", + "hide": 0, "includeAll": false, "label": "Car", + "multi": false, "name": "car_id", "options": [], "query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3429,11 +3428,14 @@ "definition": "select base_url from settings limit 1;", "hide": 2, "includeAll": false, + "multi": false, "name": "base_url", "options": [], "query": "select base_url from settings limit 1;", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3445,11 +3447,14 @@ "definition": "select unit_of_length from settings limit 1;", "hide": 2, "includeAll": false, + "multi": false, "name": "length_unit", "options": [], "query": "select unit_of_length from settings limit 1;", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3461,11 +3466,14 @@ "definition": "SELECT\n\tcoalesce(sum(cost), 0)\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(end_date)\n\tAND car_id = $car_id;\n\t", "hide": 2, "includeAll": false, + "multi": false, "name": "TotalCost", "options": [], "query": "SELECT\n\tcoalesce(sum(cost), 0)\nFROM\n\tcharging_processes\nWHERE\n\t$__timeFilter(end_date)\n\tAND car_id = $car_id;\n\t", "refresh": 2, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3477,11 +3485,14 @@ "definition": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tLEFT JOIN addresses addr ON addr.id = cp.address_id\n\tLEFT JOIN geofences geo ON geo.id = geofence_id\n\tWHERE \n\t cp.car_id = $car_id AND c.fast_charger_present\n\t\tAND (COALESCE(geo.name, CONCAT_WS(', ', COALESCE(addr.name, nullif(CONCAT_WS(' ', addr.display_name), '')))) ILIKE '%supercharger%' OR c.fast_charger_brand = 'Tesla')\n\tGROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost), 0)\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.id IN (data.charging_process_id);", "hide": 2, "includeAll": false, + "multi": false, "name": "SucCost", "options": [], "query": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tLEFT JOIN addresses addr ON addr.id = cp.address_id\n\tLEFT JOIN geofences geo ON geo.id = geofence_id\n\tWHERE \n\t cp.car_id = $car_id AND c.fast_charger_present\n\t\tAND (COALESCE(geo.name, CONCAT_WS(', ', COALESCE(addr.name, nullif(CONCAT_WS(' ', addr.display_name), '')))) ILIKE '%supercharger%' OR c.fast_charger_brand = 'Tesla')\n\tGROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost), 0)\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.id IN (data.charging_process_id);", "refresh": 2, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3493,11 +3504,14 @@ "definition": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tWHERE \n cp.car_id = $car_id AND c.fast_charger_present\n\tGROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost) - $SucCost , 0)\t\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.id IN (data.charging_process_id);", "hide": 2, "includeAll": false, + "multi": false, "name": "DCCost", "options": [], "query": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tWHERE \n cp.car_id = $car_id AND c.fast_charger_present\n\tGROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost) - $SucCost , 0)\t\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.id IN (data.charging_process_id);", "refresh": 2, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3509,11 +3523,14 @@ "definition": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tWHERE \n\t\tcp.car_id = $car_id AND c.charger_voltage != 2\n AND c.fast_charger_present IS NOT true\n GROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost) , 0)\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.cost IS NOT NULL\n AND cp.id IN (data.charging_process_id);", "hide": 2, "includeAll": false, + "multi": false, "name": "ACCost", "options": [], "query": "WITH data AS (\n\tSELECT c.charging_process_id \n\tFROM charges c\n\tLEFT JOIN charging_processes cp ON cp.id = c.charging_process_id\n\tWHERE \n\t\tcp.car_id = $car_id AND c.charger_voltage != 2\n AND c.fast_charger_present IS NOT true\n GROUP BY 1\n)\nSELECT\n coalesce(sum(cp.cost) , 0)\nFROM\n\tcharging_processes cp, data\nWHERE\n $__timeFilter(end_date)\n AND cp.cost IS NOT NULL\n AND cp.id IN (data.charging_process_id);", "refresh": 2, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3525,11 +3542,14 @@ "definition": "SELECT ROUND(convert_km((max(end_km) - min(start_km))::numeric, '$length_unit'),0) as \"Mileage\"\nFROM drives WHERE car_id = $car_id AND $__timeFilter(end_date)", "hide": 2, "includeAll": false, + "multi": false, "name": "distance_driven", "options": [], "query": "SELECT ROUND(convert_km((max(end_km) - min(start_km))::numeric, '$length_unit'),0) as \"Mileage\"\nFROM drives WHERE car_id = $car_id AND $__timeFilter(end_date)", "refresh": 2, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3541,11 +3561,14 @@ "definition": "select unit_of_temperature from settings limit 1;", "hide": 2, "includeAll": false, + "multi": false, "name": "temp_unit", "options": [], "query": "select unit_of_temperature from settings limit 1;", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3557,11 +3580,14 @@ "definition": "select preferred_range from settings limit 1;", "hide": 2, "includeAll": false, + "multi": false, "name": "preferred_range", "options": [], "query": "select preferred_range from settings limit 1;", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" }, { @@ -3572,13 +3598,17 @@ }, "definition": "SELECT name FROM geofences ORDER BY id", "description": "Geofence to display energy added at", + "hide": 0, "includeAll": false, "label": "Geofence", + "multi": false, "name": "geofence", "options": [], "query": "SELECT name FROM geofences ORDER BY id", "refresh": 1, "regex": "", + "skipUrlSync": false, + "sort": 0, "type": "query" } ] @@ -3587,12 +3617,13 @@ "from": "now-10y", "to": "now" }, + "timeRangeUpdatedDuringEditOrView": false, "timepicker": { "refresh_intervals": [] }, "timezone": "", "title": "Charging Costs Stats", "uid": "jchmDdLe5uFVk", - "version": 9, + "version": 10, "weekStart": "" } \ No newline at end of file diff --git a/dashboards/DatabaseDashboadInfo.json b/dashboards/DatabaseDashboadInfo.json index 9260ab7..2fe743e 100644 --- a/dashboards/DatabaseDashboadInfo.json +++ b/dashboards/DatabaseDashboadInfo.json @@ -5,11 +5,11 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "10.1.2" + "version": "11.0.6+security-01" }, { "type": "datasource", - "id": "postgres", + "id": "grafana-postgresql-datasource", "name": "PostgreSQL", "version": "1.0.0" }, @@ -40,9 +40,9 @@ "type": "grafana", "uid": "-- Grafana --" }, + "definition": "TeslaMate|U2FsdGVkX1/cEWK+8cz7pjEKXtzJnDN7b21ZDXt1MGneFGPWTLqOPtxKmu02mJPLzi/f29I+NBHd3vi0FB8R4Xn0+GtobWDgk6VAVSBTdSNniOKO8i2WPlhRaOsl2+hG7gnZ7wrf1Th2nxR7f1uYCrbwOek0IzkfLzrkjh7gkr6inT6bbDuJqrmogZajLxmAMrQ6V+/vHxBRGiwjJhgiEeq3hM1q2h04JKkNiZ8RHbsF5Cd/xd8Q9u0JVrZzIrtnhM/SFlaApU7RtRMu8CSj1llTX7WEOj6VDZAMSf+XUAanWdk725kEPN9MNu89o2zEq5P3E3cju8IbbBdPzXLV3oVuzD6/tMnxFToIIV1E/BrpF7s2RtNa8+KJJ1PF8xgs6m+/KTD2hy+WsP0636AgObRAmYg7+qotGrgNvpNPdE0EgrB7WHYlV7R/1q66bcq6tCe51X1Un70k+zo+K6AK0o4B1H6IyMlEVuRH/Fz8QVl9aYu2ztd08RbuKJlYVKpkH+pxVETAO9MclYQ90tzE6TfwDZrQZzsAlMenr4s1ZB1OlFXjLjVjnddnUilzO76cqv4yI2THQEuyQ47nuVQ4gUbx02K59vMQhns3C01JOAYokOaSXe66Y7QYdMlk09Lf|aes-256-cbc", "enable": true, "hide": true, - "definition": "TeslaMate|U2FsdGVkX1/cEWK+8cz7pjEKXtzJnDN7b21ZDXt1MGneFGPWTLqOPtxKmu02mJPLzi/f29I+NBHd3vi0FB8R4Xn0+GtobWDgk6VAVSBTdSNniOKO8i2WPlhRaOsl2+hG7gnZ7wrf1Th2nxR7f1uYCrbwOek0IzkfLzrkjh7gkr6inT6bbDuJqrmogZajLxmAMrQ6V+/vHxBRGiwjJhgiEeq3hM1q2h04JKkNiZ8RHbsF5Cd/xd8Q9u0JVrZzIrtnhM/SFlaApU7RtRMu8CSj1llTX7WEOj6VDZAMSf+XUAanWdk725kEPN9MNu89o2zEq5P3E3cju8IbbBdPzXLV3oVuzD6/tMnxFToIIV1E/BrpF7s2RtNa8+KJJ1PF8xgs6m+/KTD2hy+WsP0636AgObRAmYg7+qotGrgNvpNPdE0EgrB7WHYlV7R/1q66bcq6tCe51X1Un70k+zo+K6AK0o4B1H6IyMlEVuRH/Fz8QVl9aYu2ztd08RbuKJlYVKpkH+pxVETAO9MclYQ90tzE6TfwDZrQZzsAlMenr4s1ZB1OlFXjLjVjnddnUilzO76cqv4yI2THQEuyQ47nuVQ4gUbx02K59vMQhns3C01JOAYokOaSXe66Y7QYdMlk09Lf|aes-256-cbc", "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { @@ -92,11 +92,10 @@ "url": "" } ], - "liveNow": false, "panels": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -130,6 +129,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -137,22 +137,25 @@ "fields": "/.*/", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT ROUND(convert_km((max(odometer) - min(odometer))::numeric, '$length_unit'),0)|| ' $length_unit' as \"Logged\"\nfrom positions where car_id = $car_id;", - "refId": "DistanceLogged", + "rawSql": "SELECT\n ROUND(convert_km(sum(distance)::numeric, '$length_unit'), 0) || ' $length_unit' as \"Logged\",\n ROUND(convert_km(max(end_km)::numeric, '$length_unit'), 0) || ' $length_unit' as \"Odometer\"\nfrom drives where car_id = $car_id;", + "refId": "A", "select": [ [ { @@ -163,39 +166,23 @@ } ] ], - "table": "cars", - "timeColumn": "inserted_at", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - }, - { - "datasource": { - "type": "postgres", - "uid": "TeslaMate" - }, - "format": "table", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": true, - "rawSql": "select ROUND(convert_km(ROUND(odometer::numeric,0), '$length_unit'),0) || ' $length_unit' as \"Odometer\"\nfrom positions \nwhere car_id = $car_id\norder by date desc \nlimit 1;", - "refId": "Odometer", - "select": [ - [ + "sql": { + "columns": [ { - "params": [ - "efficiency" - ], - "type": "column" + "parameters": [], + "type": "function" } - ] - ], + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "cars", "timeColumn": "inserted_at", "timeColumnType": "timestamp", @@ -213,7 +200,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -247,6 +234,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -254,13 +242,15 @@ "fields": "/.*/", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -311,7 +301,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -366,7 +356,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -400,6 +390,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -407,13 +398,15 @@ "fields": "/.*/", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -464,7 +457,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -497,7 +490,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -531,6 +524,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -538,13 +532,15 @@ "fields": "/.*/", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -595,7 +591,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -649,10 +645,6 @@ "type": "stat" }, { - "datasource": { - "type": "postgres", - "uid": "TeslaMate" - }, "gridPos": { "h": 4, "w": 4, @@ -669,41 +661,7 @@ "content": "You can go to the \nIncomplete Data dashboard
\nto see details of the **Drives** or **Charges** not closed.\n", "mode": "markdown" }, - "pluginVersion": "10.1.2", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "TeslaMate" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n start_date AS \"time\",\n start_km\nFROM drives\nWHERE\n $__timeFilter(start_date)\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "start_km" - ], - "type": "column" - } - ] - ], - "table": "drives", - "timeColumn": "start_date", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], + "pluginVersion": "11.0.6+security-01", "title": "About incomplete data", "type": "text" }, @@ -722,7 +680,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "fieldConfig": { @@ -731,11 +689,12 @@ "mode": "thresholds" }, "custom": { - "align": "auto", + "align": "right", "cellOptions": { "type": "auto" }, - "inspect": false + "inspect": false, + "width": 100 }, "mappings": [], "thresholds": { @@ -750,22 +709,22 @@ "value": 80 } ] - } + }, + "unit": "bytes" }, "overrides": [ { "matcher": { "id": "byName", - "options": "Size" + "options": "Table" }, "properties": [ { "id": "custom.align", - "value": "right" + "value": "auto" }, { - "id": "custom.width", - "value": 150 + "id": "custom.width" } ] } @@ -773,7 +732,7 @@ }, "gridPos": { "h": 16, - "w": 5, + "w": 6, "x": 0, "y": 5 }, @@ -790,17 +749,17 @@ }, "showHeader": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT \r\n relname AS \"Table\",\r\n pg_size_pretty(pg_total_relation_size(relid)) As \"Size\"\r\nFROM \r\n pg_catalog.pg_statio_user_tables\r\nORDER BY \r\n pg_total_relation_size(relid) DESC;", + "rawSql": "SELECT \r\n relname AS \"Table\",\r\n pg_relation_size(relid) as \"Data\",\r\n pg_indexes_size(relid) as \"Indexes\",\r\n pg_total_relation_size(relid) As \"Total\"\r\nFROM \r\n pg_catalog.pg_statio_user_tables\r\nORDER BY \r\n pg_total_relation_size(relid) DESC;", "refId": "A", "sql": { "columns": [ @@ -825,7 +784,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "fieldConfig": { @@ -876,8 +835,8 @@ }, "gridPos": { "h": 16, - "w": 5, - "x": 5, + "w": 4, + "x": 6, "y": 5 }, "id": 38, @@ -893,17 +852,17 @@ }, "showHeader": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT table_name AS \"Table Name\", \r\n (xpath('/row/cnt/text()', xml_count))[1]::text::int AS \"Row Count\"\r\nFROM (\r\n SELECT table_name, \r\n query_to_xml(format('SELECT count(*) as cnt FROM %I.%I', table_schema, table_name), false, true, '') AS xml_count\r\n FROM information_schema.tables\r\n WHERE table_schema NOT IN ('pg_catalog', 'information_schema')\r\n) AS t\r\nORDER BY 2 DESC;", + "rawSql": "SELECT table_name AS \"Table Name\", \r\n (xpath('/row/cnt/text()', xml_count))[1]::text::int AS \"Row Count\"\r\nFROM (\r\n SELECT table_name, \r\n query_to_xml(format('SELECT count(*) as cnt FROM %I.%I', table_schema, table_name), false, true, '') AS xml_count\r\n FROM information_schema.tables\r\n WHERE table_schema NOT IN ('pg_catalog', 'information_schema') and table_type = 'BASE TABLE'\r\n) AS t\r\nORDER BY 2 DESC;", "refId": "A", "sql": { "columns": [ @@ -928,7 +887,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "These statistics can help you evaluate the efficiency of your indexes.\n\nYou should reindex all the database periodically.", @@ -938,11 +897,12 @@ "mode": "thresholds" }, "custom": { - "align": "auto", + "align": "right", "cellOptions": { "type": "auto" }, - "inspect": false + "inspect": false, + "width": 120 }, "mappings": [], "thresholds": { @@ -959,7 +919,51 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Index Size" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Table" + }, + "properties": [ + { + "id": "custom.width", + "value": 200 + }, + { + "id": "custom.align", + "value": "auto" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Index" + }, + "properties": [ + { + "id": "custom.width" + }, + { + "id": "custom.align", + "value": "auto" + } + ] + } + ] }, "gridPos": { "h": 16, @@ -981,17 +985,17 @@ }, "showHeader": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT\r\n relname AS \"Table\",\r\n indexrelname AS \"Index\",\r\n idx_scan AS \"Index Scans\",\r\n idx_tup_read AS \"Tuples Read\",\r\n idx_tup_fetch AS \"Tuples Fetched\"\r\nFROM\r\n pg_stat_all_indexes\r\nWHERE\r\n schemaname NOT LIKE 'pg_%' AND\r\n indexrelname IS NOT NULL\r\nORDER BY 3 DESC;", + "rawSql": "SELECT\r\n relname AS \"Table\",\r\n indexrelname AS \"Index\",\r\n idx_scan AS \"Index Scans\",\r\n idx_tup_read AS \"Tuples Read\",\r\n idx_tup_fetch AS \"Tuples Fetched\",\r\n PG_RELATION_SIZE(indexrelid) as \"Index Size\"\r\nFROM\r\n pg_stat_all_indexes\r\nWHERE\r\n schemaname NOT LIKE 'pg_%' AND\r\n indexrelname IS NOT NULL\r\nORDER BY 3 DESC;", "refId": "A", "sql": { "columns": [ @@ -1017,7 +1021,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -1035,7 +1039,8 @@ "value": null } ] - } + }, + "unit": "bytes" }, "overrides": [] }, @@ -1051,6 +1056,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1058,13 +1064,15 @@ "fields": "/.*/", "values": false }, - "textMode": "value" + "showPercentChange": false, + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -1073,7 +1081,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT \n pg_size_pretty(SUM(pg_total_relation_size(relid))) As \"Size\"\nFROM \n pg_catalog.pg_statio_user_tables;", + "rawSql": "SELECT \n SUM(pg_total_relation_size(relid)) As \"Size\"\nFROM \n pg_catalog.pg_statio_user_tables;", "refId": "DistanceLogged", "select": [ [ @@ -1119,7 +1127,7 @@ }, { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "description": "", @@ -1160,6 +1168,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -1167,13 +1176,15 @@ "fields": "/.*/", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.2", + "pluginVersion": "11.0.6+security-01", "targets": [ { "datasource": { - "type": "postgres", + "type": "grafana-postgresql-datasource", "uid": "TeslaMate" }, "editorMode": "code", @@ -1203,54 +1214,671 @@ ], "title": "About Teslamate Custom Dashboards", "type": "stat" - } - ], - "refresh": "", - "schemaVersion": 38, - "style": "dark", - "tags": [ - "TeslamateCustomDashboards" - ], - "templating": { - "list": [ - { - "current": {}, - "datasource": { - "type": "postgres", - "uid": "TeslaMate" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 44, + "panels": [], + "title": "Statistics of SQL planning and execution", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "super-light-blue", + "value": null + } + ] + } }, - "definition": "select unit_of_length from settings limit 1;", - "hide": 2, - "includeAll": false, - "label": "", - "multi": false, - "name": "length_unit", - "options": [], - "query": "select unit_of_length from settings limit 1;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false + "overrides": [] }, - { - "current": {}, - "datasource": { - "type": "postgres", - "uid": "TeslaMate" + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 25 + }, + "id": 48, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [], + "fields": "/.*/", + "values": false }, - "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", - "description": "", - "hide": 0, - "includeAll": false, - "label": "Car", - "multi": false, - "name": "car_id", + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "11.0.6+security-01", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "${pg_stat_statements_info_last_reset:raw}", + "refId": "Charges", + "select": [ + [ + { + "params": [ + "efficiency" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "cars", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Time at which all statistics in the pg_stat_statements view were last reset", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "super-light-blue", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 25 + }, + "id": 49, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "11.0.6+security-01", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "${pg_stat_statements_count:raw}", + "refId": "Charges", + "select": [ + [ + { + "params": [ + "efficiency" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "cars", + "timeColumn": "inserted_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Number of Statements tracked via pg_stat_statements", + "type": "stat" + }, + { + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 25 + }, + "id": 47, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "See the [contribution docs](https://docs.teslamate.org/docs/development#enable-pg_stat_statements-to-collect-query-statistics) on how to enable tracking planning and execution statistics of all SQL statements executed by a server.\n", + "mode": "markdown" + }, + "pluginVersion": "11.0.6+security-01", + "title": "About pg_stat_statements (track statistics of SQL planning and execution)", + "type": "text" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto", + "wrapText": false + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Calls" + }, + "properties": [ + { + "id": "unit", + "value": "none" + }, + { + "id": "custom.width", + "value": 80 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Query" + }, + "properties": [ + { + "id": "custom.inspect", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mean Exec Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 140 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Exec Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 140 + } + ] + } + ] + }, + "gridPos": { + "h": 14, + "w": 12, + "x": 0, + "y": 28 + }, + "id": 45, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "11.0.6+security-01", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "${pg_stat_statements_top_20_mean:raw}", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 20 Statements (by mean time spent executing the statement)", + "type": "table" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto", + "wrapText": false + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Calls" + }, + "properties": [ + { + "id": "unit", + "value": "none" + }, + { + "id": "custom.width", + "value": 80 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Query" + }, + "properties": [ + { + "id": "custom.inspect", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mean Exec Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 140 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Exec Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 140 + } + ] + } + ] + }, + "gridPos": { + "h": 14, + "w": 12, + "x": 12, + "y": 28 + }, + "id": 46, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "11.0.6+security-01", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "${pg_stat_statements_top_20_total:raw}", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 20 Statements (by total time spent executing the statement)", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "TeslamateCustomDashboards" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "select unit_of_length from settings limit 1;", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "length_unit", + "options": [], + "query": "select unit_of_length from settings limit 1;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT\n id as __value,\n CASE WHEN COUNT(id) OVER (PARTITION BY name) > 1 AND name IS NOT NULL THEN CONCAT(name, ' - ', RIGHT(vin, 6)) ELSE COALESCE(name, RIGHT(vin, 6)) end as __text \nFROM cars\nORDER BY display_priority ASC, name ASC, vin ASC;", + "hide": 0, + "includeAll": false, + "label": "Car", + "multi": false, + "name": "car_id", + "options": [], + "query": "SELECT\n id as __value,\n CASE WHEN COUNT(id) OVER (PARTITION BY name) > 1 AND name IS NOT NULL THEN CONCAT(name, ' - ', RIGHT(vin, 6)) ELSE COALESCE(name, RIGHT(vin, 6)) end as __text \nFROM cars\nORDER BY display_priority ASC, name ASC, vin ASC;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'SELECT stats_reset FROM pg_stat_statements_info;' else 'SELECT NULL;' end", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "pg_stat_statements_info_last_reset", + "options": [], + "query": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'SELECT stats_reset FROM pg_stat_statements_info;' else 'SELECT NULL;' end", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'SELECT count(*) FROM pg_stat_statements;' else 'SELECT NULL;' end", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "pg_stat_statements_count", + "options": [], + "query": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'SELECT count(*) FROM pg_stat_statements;' else 'SELECT NULL;' end", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'select\n calls as \"Calls\",\n mean_exec_time as \"Mean Exec Time\",\n total_exec_time as \"Total Exec Time\",\n query as \"Query\"\nfrom pg_stat_statements\nORDER BY mean_exec_time desc\nlimit 20;' else 'SELECT NULL;' end", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "pg_stat_statements_top_20_mean", + "options": [], + "query": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'select\n calls as \"Calls\",\n mean_exec_time as \"Mean Exec Time\",\n total_exec_time as \"Total Exec Time\",\n query as \"Query\"\nfrom pg_stat_statements\nORDER BY mean_exec_time desc\nlimit 20;' else 'SELECT NULL;' end", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'select\n calls as \"Calls\",\n mean_exec_time as \"Mean Exec Time\",\n total_exec_time as \"Total Exec Time\",\n query as \"Query\"\nfrom pg_stat_statements\nORDER BY total_exec_time desc\nlimit 20;' else 'SELECT NULL;' end", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "pg_stat_statements_top_20_total", + "options": [], + "query": "SELECT\n CASE WHEN $pg_stat_statements_enabled = 1 THEN 'select\n calls as \"Calls\",\n mean_exec_time as \"Mean Exec Time\",\n total_exec_time as \"Total Exec Time\",\n query as \"Query\"\nfrom pg_stat_statements\nORDER BY total_exec_time desc\nlimit 20;' else 'SELECT NULL;' end", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT EXISTS (\nSELECT 1\nFROM information_schema.tables\nWHERE table_name = 'pg_stat_statements'\n)::int AS table_existence", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "pg_stat_statements_enabled", "options": [], - "query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", + "query": "SELECT EXISTS (\nSELECT 1\nFROM information_schema.tables\nWHERE table_name = 'pg_stat_statements'\n)::int AS table_existence", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -1263,6 +1891,7 @@ "from": "now-6h", "to": "now" }, + "timeRangeUpdatedDuringEditOrView": false, "timepicker": { "hidden": true, "refresh_intervals": [] @@ -1270,6 +1899,6 @@ "timezone": "browser", "title": "Database Information", "uid": "jchm_dbInfo", - "version": 3, + "version": 4, "weekStart": "" } \ No newline at end of file