diff --git a/docker-compose/grafana/dashboards/archiver_timescale.json b/docker-compose/grafana/dashboards/archiver_timescale.json index 4678ce060a18366efea5f386f217e09475222119..bec06ef691e2a89e8e75e264a7f3d9f120a82ea4 100644 --- a/docker-compose/grafana/dashboards/archiver_timescale.json +++ b/docker-compose/grafana/dashboards/archiver_timescale.json @@ -63,7 +63,7 @@ "options": { "showHeader": true }, - "pluginVersion": "8.2.4", + "pluginVersion": "8.2.5", "targets": [ { "format": "table", @@ -135,7 +135,7 @@ "options": { "showHeader": true }, - "pluginVersion": "8.2.4", + "pluginVersion": "8.2.5", "targets": [ { "format": "table", @@ -169,110 +169,6 @@ "title": "LTS/RECV/1 archived attributes", "type": "table" }, - { - "datasource": "TimescaleDB", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.2.4", - "targets": [ - { - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n temp_time AS \"time\",\n temperature[1] as \"temp[1]\",\n temperature[2] as \"temp[2]\",\n temperature[3] as \"temp[3]\",\n temperature[4] as \"temp[4]\",\n temperature[5] as \"temp[5]\",\n temperature[6] as \"temp[6]\",\n temperature[7] as \"temp[7]\",\n temperature[8] as \"temp[8]\",\n temperature[9] as \"temp[9]\",\n temperature[10] as \"temp[10]\",\n temperature[11] as \"temp[11]\",\n temperature[12] as \"temp[12]\",\n temperature[13] as \"temp[13]\",\n temperature[14] as \"temp[14]\",\n temperature[15] as \"temp[15]\",\n temperature[16] as \"temp[16]\"\nFROM sdp_masked_temp_values\nWHERE\n $__timeFilter(temp_time)\nORDER BY temp_time", - "refId": "B", - "select": [ - [ - { - "params": [ - "temperature[1]" - ], - "type": "column" - } - ] - ], - "table": "sdp_masked_temp_values", - "timeColumn": "temp_time", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "SDP - FPGA Temperature", - "type": "timeseries" - }, { "datasource": "TimescaleDB", "fieldConfig": { @@ -304,17 +200,19 @@ "gridPos": { "h": 9, "w": 12, - "x": 12, + "x": 0, "y": 8 }, "id": 9, + "interval": "10s", + "maxDataPoints": 1000, "options": { - "colWidth": 0.5, + "colWidth": 0.3, "legend": { "displayMode": "list", "placement": "bottom" }, - "rowHeight": 0.9, + "rowHeight": 0.78, "showValue": "auto", "tooltip": { "mode": "single" @@ -328,7 +226,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n temp_time AS \"time\",\n temperature[1] as \"temp[1]\",\n temperature[2] as \"temp[2]\",\n temperature[3] as \"temp[3]\",\n temperature[4] as \"temp[4]\",\n temperature[5] as \"temp[5]\",\n temperature[6] as \"temp[6]\",\n temperature[7] as \"temp[7]\",\n temperature[8] as \"temp[8]\",\n temperature[9] as \"temp[9]\",\n temperature[10] as \"temp[10]\",\n temperature[11] as \"temp[11]\",\n temperature[12] as \"temp[12]\",\n temperature[13] as \"temp[13]\",\n temperature[14] as \"temp[14]\",\n temperature[15] as \"temp[15]\",\n temperature[16] as \"temp[16]\"\nFROM sdp_masked_temp_values\nWHERE\n $__timeFilter(temp_time)\nORDER BY temp_time", + "rawSql": "SELECT time_bucket('00:00:01'::interval, q1.\"time\") AS time,\r\n mask(array[q1.value[1]], array[q2.\"value\"[1]]) AS \"temperature[1]\",\r\n mask(array[q1.value[2]], array[q2.\"value\"[2]]) AS \"temperature[2]\",\r\n mask(array[q1.value[3]], array[q2.\"value\"[3]]) AS \"temperature[3]\",\r\n mask(array[q1.value[4]], array[q2.\"value\"[4]]) AS \"temperature[4]\",\r\n mask(array[q1.value[5]], array[q2.\"value\"[5]]) AS \"temperature[5]\",\r\n mask(array[q1.value[6]], array[q2.\"value\"[6]]) AS \"temperature[6]\",\r\n mask(array[q1.value[7]], array[q2.\"value\"[7]]) AS \"temperature[7]\",\r\n mask(array[q1.value[8]], array[q2.\"value\"[8]]) AS \"temperature[8]\",\r\n mask(array[q1.value[9]], array[q2.\"value\"[9]]) AS \"temperature[9]\",\r\n mask(array[q1.value[10]], array[q2.\"value\"[10]]) AS \"temperature[10]\",\r\n mask(array[q1.value[11]], array[q2.\"value\"[11]]) AS \"temperature[11]\",\r\n mask(array[q1.value[12]], array[q2.\"value\"[12]]) AS \"temperature[12]\",\r\n mask(array[q1.value[13]], array[q2.\"value\"[13]]) AS \"temperature[13]\",\r\n mask(array[q1.value[14]], array[q2.\"value\"[14]]) AS \"temperature[14]\",\r\n mask(array[q1.value[15]], array[q2.\"value\"[15]]) AS \"temperature[15]\"\r\n FROM ( SELECT aad.data_time AS \"time\",\r\n aad.value_r AS value\r\n FROM att_array_devdouble aad\r\n JOIN att_conf ac ON aad.att_conf_id = ac.att_conf_id\r\n WHERE aad.value_r IS NOT NULL AND ac.domain = 'stat'::text AND ac.family = 'sdp'::text AND ac.member = '1'::text AND ac.name = 'fpga_temp_r'::text\r\n ORDER BY aad.data_time) q1\r\n JOIN ( SELECT aab.data_time AS \"time\",\r\n aab.value_r AS value\r\n FROM att_array_devboolean aab\r\n JOIN att_conf ac ON aab.att_conf_id = ac.att_conf_id\r\n WHERE aab.value_r IS NOT NULL AND ac.domain = 'stat'::text AND ac.family = 'sdp'::text AND ac.member = '1'::text AND ac.name = 'tr_fpga_mask_r'::text\r\n ORDER BY aab.data_time) q2 ON time_bucket('00:00:01'::interval, q1.\"time\") = time_bucket('00:00:01'::interval, q2.\"time\")\r\n WHERE $__timeFilter(q1.\"time\")\r\n ORDER BY q1.\"time\";", "refId": "B", "select": [ [ @@ -364,7 +262,7 @@ "list": [] }, "time": { - "from": "now-1h", + "from": "now-5m", "to": "now" }, "timepicker": {}, diff --git a/docker-compose/timescaledb/resources/07_cleanup.sql b/docker-compose/timescaledb/resources/06_cleanup.sql similarity index 100% rename from docker-compose/timescaledb/resources/07_cleanup.sql rename to docker-compose/timescaledb/resources/06_cleanup.sql diff --git a/docker-compose/timescaledb/resources/06_lofar_views.sql b/docker-compose/timescaledb/resources/06_lofar_views.sql deleted file mode 100644 index 7f7581cc132787d9ae3a443116178058a01d28b9..0000000000000000000000000000000000000000 --- a/docker-compose/timescaledb/resources/06_lofar_views.sql +++ /dev/null @@ -1,35 +0,0 @@ --- LOFAR 2.0 CUSTOMIZED VIEWS - -\c hdb --- SDP FPGA Temperature -create or replace view "sdp_fpga_temp" as -select - ac.att_name as "attribute", - aad.data_time AS "time", - aad.value_r -FROM att_array_devdouble aad join att_conf ac -on aad.att_conf_id = ac.att_conf_id -where aad.value_R is not null -and ac."domain" ='stat' and ac."family" ='sdp' and ac."member" ='1' and ac."name"='fpga_temp_r' -ORDER BY aad.data_time; - --- SDP FPGA Mask -create or replace view "sdp_tr_fpga_mask" as -select - ac.att_name as "attribute", - aab.data_time AS "time", - aab.value_r -FROM att_array_devboolean aab join att_conf ac -on aab.att_conf_id = ac.att_conf_id -where aab.value_R is not null -and ac."domain" ='stat' and ac."family" ='sdp' and ac."member" ='1' and ac."name"='tr_fpga_mask_r' -ORDER BY aab.data_time; - --- SDP Masked values (rounded to 1 second) -create or replace view "sdp_masked_temp_values" as -select time_bucket('1 second',t.time) as "temp_time", -mask(t.value_r,m.value_r) as "temperature" -from sdp_fpga_temp as t -inner join sdp_tr_fpga_mask as m -on time_bucket('1 second',t.time) = time_bucket('1 second',m.time) -order by t."time";