{ "__inputs": [ { "name": "DS_ALBS_ANALYTICS", "label": "albs_analytics", "description": "", "type": "datasource", "pluginId": "postgres", "pluginName": "PostgreSQL" } ], "__elements": {}, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "9.3.6" }, { "type": "panel", "id": "piechart", "name": "Pie chart", "version": "" }, { "type": "datasource", "id": "postgres", "name": "PostgreSQL", "version": "1.0.0" }, { "type": "panel", "id": "stat", "name": "Stat", "version": "" }, { "type": "panel", "id": "table", "name": "Table", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "editable": false, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": false, "panels": [ { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 17, "panels": [], "title": "Summary", "type": "row" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [ { "matcher": { "id": "byName", "options": "finished" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "running" }, "properties": [ { "id": "color", "value": { "fixedColor": "semi-dark-blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 1 }, "id": 9, "options": { "legend": { "displayMode": "table", "placement": "right", "showLegend": true, "values": [ "value" ] }, "pieType": "donut", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS finished\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at is NOT NULL;", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS running\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at is NULL;", "refId": "C", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Builds", "type": "piechart" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "description": "", "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [ { "matcher": { "id": "byName", "options": "running" }, "properties": [ { "id": "color", "value": { "fixedColor": "semi-dark-blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "completed" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "idle" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "failed" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "excluded" }, "properties": [ { "id": "color", "value": { "fixedColor": "text", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 1 }, "id": 10, "options": { "legend": { "displayMode": "table", "placement": "right", "showLegend": true, "values": [ "value" ] }, "pieType": "donut", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS idle FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND status_id = 0;", "refId": "idle", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS started FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND status_id = 1;", "refId": "started", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS completed FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND status_id = 2;", "refId": "completed", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS failed FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND status_id = 3;", "refId": "failed", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS excluded FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND status_id = 4;", "refId": "excluded", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Build tasks by status", "type": "piechart" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "description": "", "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [ { "matcher": { "id": "byName", "options": "running" }, "properties": [ { "id": "color", "value": { "fixedColor": "semi-dark-blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "completed" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "idle" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "failed" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "excluded" }, "properties": [ { "id": "color", "value": { "fixedColor": "text", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "x86_64" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "i686" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "aarch64" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "ppc64le" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 1 }, "id": 11, "options": { "legend": { "displayMode": "table", "placement": "right", "showLegend": true, "values": [ "value" ] }, "pieType": "donut", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS i686 FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND arch_id = 0;", "refId": "i686", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS x86_64 FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND arch_id = 1;", "refId": "x86_64", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS aarch64 FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND arch_id = 2;", "refId": "aarch64", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS ppc64le FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND arch_id = 3;", "refId": "ppc64le", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(id) AS s390x FROM build_tasks \nWHERE $__unixEpochFilter(started_at) AND arch_id = 4;", "refId": "excluded", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Build tasks by arch", "type": "piechart" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 8 }, "id": 13, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.6", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT MAX(finished_at - created_at) AS MAX\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "refId": "MAX", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" }, { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "hide": false, "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT MIN(finished_at - created_at) AS MIN\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "refId": "MIN", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" }, { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "hide": false, "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT AVG(finished_at - created_at) AS AVG\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "refId": "AVG", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" } ], "title": "Build duration", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "description": "", "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 8 }, "id": 18, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.6", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT MAX(finished_at - started_at) AS MAX\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND status_id=2;", "refId": "MAX", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" }, { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "hide": false, "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT MIN(finished_at - started_at) AS MIN\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND status_id = 2;", "refId": "MIN", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" }, { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "hide": false, "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT AVG(finished_at - started_at) AS AVG\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND status_id <> 2", "refId": "AVG", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" } ], "title": "Build task duration", "type": "stat" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 }, "id": 5, "panels": [], "title": "Build details", "type": "row" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "center", "displayMode": "auto", "filterable": true, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "duration" }, "properties": [ { "id": "unit", "value": "s" } ] }, { "matcher": { "id": "byName", "options": "url" }, "properties": [ { "id": "custom.width", "value": 287 } ] }, { "matcher": { "id": "byName", "options": "id" }, "properties": [ { "id": "custom.width", "value": 107 } ] } ] }, "gridPos": { "h": 15, "w": 24, "x": 0, "y": 16 }, "id": 2, "options": { "footer": { "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "duration" } ] }, "pluginVersion": "9.3.6", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "hide": false, "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT \n b.id, \n b.url, \n b.created_at * 1000 as created,\n b.finished_at * 1000 as finished,\n (SELECT COUNT(id) FROM build_tasks AS bt WHERE bt.build_id = b.id) AS task_count,\n b.finished_at - b.created_at as duration\nFROM builds as b \nWHERE $__unixEpochFilter(created_at) AND b.finished_at IS NOT NULL", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" } ], "title": "Finished builds", "transformations": [ { "id": "convertFieldType", "options": { "conversions": [ { "destinationType": "time", "targetField": "created" }, { "destinationType": "time", "targetField": "finished" } ], "fields": {} } } ], "type": "table" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 31 }, "id": 7, "panels": [], "title": "Build tasks details", "type": "row" }, { "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "center", "displayMode": "auto", "filterable": true, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "duration" }, "properties": [ { "id": "unit", "value": "s" } ] } ] }, "gridPos": { "h": 12, "w": 24, "x": 0, "y": 32 }, "id": 15, "options": { "footer": { "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": false, "displayName": "duration" } ] }, "pluginVersion": "9.3.6", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_ALBS_ANALYTICS}" }, "editorMode": "code", "fields": [ { "jsonPath": "" } ], "format": "table", "method": "GET", "queryParams": "", "rawQuery": true, "rawSql": "SELECT\n bt.id,\n bt.name,\n bt.build_id,\n arch_enum.value AS arch,\n status_enum.value AS status,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n bt.finished_at - bt.started_at AS duration \nFROM build_tasks AS bt\nJOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\nJOIN arch_enum on bt.arch_id = arch_enum.id\nWHERE $__unixEpochFilter(started_at) AND status_id >= 2;", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "urlPath": "" } ], "title": "Finished buld tasks", "transformations": [ { "id": "convertFieldType", "options": { "conversions": [ { "destinationType": "time", "targetField": "started" }, { "destinationType": "time", "targetField": "finished" } ], "fields": {} } } ], "type": "table" } ], "refresh": "1m", "schemaVersion": 37, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-2d", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Build analytics", "uid": "02mg4oxVk", "version": 5, "weekStart": "" }