diff --git a/build_analytics/build_analytics/db.py b/build_analytics/build_analytics/db.py index a204192..0dbd7ed 100644 --- a/build_analytics/build_analytics/db.py +++ b/build_analytics/build_analytics/db.py @@ -26,6 +26,17 @@ class DB(): def __del__(self): self.close_conn() + def build_exists(self, build_id: int) -> bool: + sql = f''' + SELECT COUNT(id) + FROM builds + WHERE id = %s; + ''' + cur = self.__conn.cursor() + cur.execute(sql, (build_id,)) + val = int(cur.fetchone()[0]) + return val == 1 + def insert_build(self, build: BuildDB): sql = ''' INSERT INTO builds(id, url, created_at, finished_at) diff --git a/build_analytics/build_analytics/extractor/extractor.py b/build_analytics/build_analytics/extractor/extractor.py index 45770bc..4789b35 100644 --- a/build_analytics/build_analytics/extractor/extractor.py +++ b/build_analytics/build_analytics/extractor/extractor.py @@ -34,6 +34,10 @@ class Extractor: stop = True break + # some builds could move from one page to another + if self.db.build_exists(build_id=build.id): + continue + # inserting build build tasks and build tasks statistics logging.info('inserting %s', build.id) try: diff --git a/build_analytics/grafana-dashbords/Build analytics.json b/build_analytics/grafana-dashbords/Build analytics.json index 91f303a..4c99dac 100644 --- a/build_analytics/grafana-dashbords/Build analytics.json +++ b/build_analytics/grafana-dashbords/Build analytics.json @@ -87,7 +87,7 @@ }, "id": 17, "panels": [], - "title": "Summary", + "title": "Builds", "type": "row" }, { @@ -1427,7 +1427,7 @@ "type": "stat" }, { - "collapsed": true, + "collapsed": false, "gridPos": { "h": 1, "w": 24, @@ -1435,1850 +1435,2331 @@ "y": 13 }, "id": 26, - "panels": [ - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "#61a69d", - "mode": "fixed" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "s" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build_binaries" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "purple", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "upload" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "packages_processing" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build_srpm" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "notarize_artifacts" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "yellow", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "logs_processing" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "source_authenticate" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "git_checkout" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "light-red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 14 - }, - "id": 33, - "options": { - "legend": { - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "percent" - ] - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as upload\nFROM build_node_stats \nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts);", - "refId": "upload", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "start_ts", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "build_node_stats", - "urlPath": "" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as build_srpm\nFROM build_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as git_checkout\nFROM build_node_stats \nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts);", - "refId": "git_checkout", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as build_binaries\nFROM build_node_stats \nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts);", - "refId": "build_binaries", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as notarize_artifacts\nFROM build_node_stats \nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)", - "refId": "cas_notarize_artifacts", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as source_authenticate\nFROM build_node_stats \nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts);", - "refId": "cas_source_authenticate", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as logs_processing\nFROM web_node_stats \nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts);", - "refId": "logs_processing", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as packages_processing\nFROM web_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", - "refId": "packages_procession", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Duration (%)", - "type": "piechart" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "#61a69d", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "s" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "wait_time" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 16, - "x": 8, - "y": 14 - }, - "id": 20, - "options": { - "displayMode": "basic", - "minVizHeight": 10, - "minVizWidth": 0, - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": false - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as git_checkout\nFROM build_node_stats \nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts);", - "refId": "git_checkout", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as source_authenticate\nFROM build_node_stats \nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts);", - "refId": "cas_source_authenticate", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as build_srpm\nFROM build_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as build_binaries\nFROM build_node_stats \nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts);", - "refId": "build_binaries", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as notarize_artifacts\nFROM build_node_stats \nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)", - "refId": "cas_notarize_artifacts", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as logs_processing\nFROM web_node_stats \nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts);", - "refId": "logs_processing", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as packages_processing\nFROM web_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", - "refId": "packages_processing", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - }, - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT SUM(end_ts - start_ts) as upload\nFROM build_node_stats \nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts);", - "refId": "upload", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "start_ts", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "build_node_stats", - "urlPath": "" - } - ], - "title": "Duration (absolute)", - "type": "bargauge" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest git_checkout step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build_task" - }, - "properties": [ - { - "id": "custom.width", - "value": 82 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 87 - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 0, - "y": 22 - }, - "id": 28, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "git_checkout", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest source_authenticate step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 78 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 3, - "y": 22 - }, - "id": 31, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "source_authenticate", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest build_binaries step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 81 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 6, - "y": 22 - }, - "id": 29, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "build_binaries", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest build_srpm step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 81 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 82 - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 9, - "y": 22 - }, - "id": 27, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "build_srpm", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest notarize_artifacts step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 78 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 12, - "y": 22 - }, - "id": 30, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "notarize_artifacts", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest logs_processing step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 78 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 15, - "y": 22 - }, - "id": 32, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM web_node_stats\nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "logs_processing", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build tasks with longest packages_processing step", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 78 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 18, - "y": 22 - }, - "id": 34, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM web_node_stats\nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "packages_processing", - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "Top 5 build_tasks with longest upload", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 79 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build task" - }, - "properties": [ - { - "id": "custom.width", - "value": 88 - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 21, - "y": 22 - }, - "id": 35, - "options": { - "footer": { - "enablePagination": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT build_task_id AS \"build task\" , (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", - "refId": "build_srpm", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "upload", - "type": "table" - } - ], + "panels": [], "title": "Build Steps", "type": "row" }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "#61a69d", + "mode": "fixed" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build_binaries" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "upload" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "packages_processing" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build_srpm" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "notarize_artifacts" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "logs_processing" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "source_authenticate" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "git_checkout" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 14 + }, + "id": 33, + "options": { + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as upload\nFROM build_node_stats \nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts);", + "refId": "upload", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "start_ts", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "build_node_stats", + "urlPath": "" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as build_srpm\nFROM build_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as git_checkout\nFROM build_node_stats \nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts);", + "refId": "git_checkout", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as build_binaries\nFROM build_node_stats \nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts);", + "refId": "build_binaries", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as notarize_artifacts\nFROM build_node_stats \nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)", + "refId": "cas_notarize_artifacts", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as source_authenticate\nFROM build_node_stats \nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts);", + "refId": "cas_source_authenticate", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as logs_processing\nFROM web_node_stats \nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts);", + "refId": "logs_processing", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as packages_processing\nFROM web_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", + "refId": "packages_procession", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Duration (%)", + "type": "piechart" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "#61a69d", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "wait_time" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 14 + }, + "id": 20, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as git_checkout\nFROM build_node_stats \nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts);", + "refId": "git_checkout", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as source_authenticate\nFROM build_node_stats \nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts);", + "refId": "cas_source_authenticate", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as build_srpm\nFROM build_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as build_binaries\nFROM build_node_stats \nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts);", + "refId": "build_binaries", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as notarize_artifacts\nFROM build_node_stats \nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)", + "refId": "cas_notarize_artifacts", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as logs_processing\nFROM web_node_stats \nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts);", + "refId": "logs_processing", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as packages_processing\nFROM web_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);", + "refId": "packages_processing", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT SUM(end_ts - start_ts) as upload\nFROM build_node_stats \nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts);", + "refId": "upload", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "start_ts", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "build_node_stats", + "urlPath": "" + } + ], + "title": "Duration (absolute)", + "type": "bargauge" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest git_checkout step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build_task" + }, + "properties": [ + { + "id": "custom.width", + "value": 82 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 87 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 0, + "y": 22 + }, + "id": 28, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "git_checkout", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest source_authenticate step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 78 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 3, + "y": 22 + }, + "id": 31, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "source_authenticate", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest build_binaries step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 81 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 6, + "y": 22 + }, + "id": 29, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "build_binaries", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest build_srpm step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 81 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 82 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 9, + "y": 22 + }, + "id": 27, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "build_srpm", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest notarize_artifacts step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 78 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 12, + "y": 22 + }, + "id": 30, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "notarize_artifacts", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest logs_processing step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 78 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 15, + "y": 22 + }, + "id": 32, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM web_node_stats\nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "logs_processing", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build tasks with longest packages_processing step", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 78 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 18, + "y": 22 + }, + "id": 34, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\", (end_ts - start_ts) as duration\nFROM web_node_stats\nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "packages_processing", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "Top 5 build_tasks with longest upload", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 79 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task" + }, + "properties": [ + { + "id": "custom.width", + "value": 88 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 21, + "y": 22 + }, + "id": 35, + "options": { + "footer": { + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT build_task_id AS \"build task\" , (end_ts - start_ts) as duration\nFROM build_node_stats\nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts)\nORDER BY duration DESC\nLIMIT 5;", + "refId": "build_srpm", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "upload", + "type": "table" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 29 + }, + "id": 49, + "panels": [], + "title": "Tests", + "type": "row" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 13, + "x": 0, + "y": 30 + }, + "id": 45, + "options": { + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tt.id),\n enum.value AS status\nFROM test_tasks AS tt\nINNER JOIN test_tasks_status_enum AS enum\nON tt.status_id = enum.id\nWHERE $__unixEpochFilter(started_at)\nGROUP BY (status);\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Tests count (group by status)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "piechart" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 11, + "x": 13, + "y": 30 + }, + "id": 56, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n MAX(t.duration) AS \"MAX\",\n MIN(t.duration) AS \"MIN\",\n AVG(t.duration) AS \"AVERAGE\",\n PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY t.duration) as \"MEDIAN\",\n PERCENTILE_CONT(0.95) WITHIN GROUP(ORDER BY t.duration) as \"95TH PERCENTILE\"\nFROM\n (SELECT \n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\n FROM test_tasks AS tt\n INNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\n INNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\n INNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n WHERE $__unixEpochFilter(tt.started_at)\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\n WHERE $__unixEpochFilter(tt.started_at)\n ) AS t;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Tests duration", + "type": "stat" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 36 + }, + "id": 58, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n enum.value AS \"step name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE $__unixEpochFilter(tt.started_at)\nGROUP BY (enum.value); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test duration (group by test step)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 42 + }, + "id": 59, + "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_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n aenum.value AS arch,\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN build_tasks as bt\n ON tt.build_task_id = bt.id\nINNER JOIN arch_enum as aenum\n ON bt.arch_id = aenum.id\nWHERE $__unixEpochFilter(tt.started_at)\nGROUP BY (aenum.value); \n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Tests duration (group by arch)", + "transformations": [ + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + } + ], + "type": "piechart" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 16, + "x": 8, + "y": 42 + }, + "id": 47, + "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_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n tt.package_fullname AS \"package name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nWHERE $__unixEpochFilter(started_at)\nGROUP BY (tt.package_fullname); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Tests duration (group by package)", + "transformations": [ + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + } + ], + "type": "piechart" + }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 14 + "y": 49 }, "id": 24, "panels": [ @@ -3304,8 +3785,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3374,7 +3854,7 @@ "h": 15, "w": 24, "x": 0, - "y": 15 + "y": 62 }, "id": 2, "options": { @@ -3456,527 +3936,893 @@ "type": "table" } ], - "title": "Builds", + "title": "Details: builds", "type": "row" }, { - "collapsed": false, + "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 15 + "y": 50 }, "id": 39, - "panels": [], - "title": "Build tasks", + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "task_duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.width", + "value": 124 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" + } + ] + }, + { + "id": "custom.width", + "value": 81 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build_id" + }, + "properties": [ + { + "id": "custom.width", + "value": 88 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 274 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build id" + }, + "properties": [ + { + "id": "custom.width", + "value": 89 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "arch" + }, + "properties": [ + { + "id": "custom.width", + "value": 104 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "finished" + }, + "properties": [ + { + "id": "custom.width", + "value": 220 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "started" + }, + "properties": [ + { + "id": "custom.width", + "value": 197 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "status" + }, + "properties": [ + { + "id": "custom.width", + "value": 152 + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 61 + }, + "id": 37, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "task_duration" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "hide": false, + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": " SELECT\n bt.id,\n bt.build_id AS \"build id\",\n bt.name,\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 task_duration\n FROM build_tasks AS bt\n JOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\n JOIN arch_enum on bt.arch_id = arch_enum.id \n WHERE $__unixEpochFilter(started_at)", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "hide": true, + "rawQuery": true, + "rawSql": "SELECT\n bt.id, \n bt.build_id,\n SUM(bt.finished_at - bt.started_at) AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\nFROM build_tasks AS bt\nWHERE $__unixEpochFilter(started_at) \nGROUP BY bt.id;", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "All build tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + }, + { + "id": "joinByField", + "options": { + "byField": "id", + "mode": "outer" + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(.*duration)|(wait time)" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 70 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "arch" + }, + "properties": [ + { + "id": "custom.width", + "value": 111 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n\n" + } + ] + }, + { + "id": "custom.width", + "value": 80 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 294 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "task duration" + }, + "properties": [ + { + "id": "custom.width", + "value": 100 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 70 + }, + "id": 43, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "task duration" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT\n bt.id,\n bt.build_id AS \"build id\",\n bt.name,\n arch_enum.value AS arch,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n task_duration AS \"task duration\",\n web_node_duration AS \"web node duration\",\n build_node_duration AS \"build node duration\",\n task_duration - web_node_duration - build_node_duration as \"wait time\"\n FROM build_tasks AS bt\n JOIN arch_enum on bt.arch_id = arch_enum.id \n LEFT JOIN \n (\n SELECT\n bt.id,\n bt.finished_at - bt.started_at AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\n FROM build_tasks AS bt\n WHERE $__unixEpochFilter(started_at) AND status_id = 2\n GROUP BY bt.id\n ) as d\n ON bt.id = d.id\n WHERE $__unixEpochFilter(started_at) AND status_id = 2", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Completed build tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + } + ], + "title": "Details: build tasks", "type": "row" }, { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "filterable": true, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "task_duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - }, - { - "id": "custom.width", - "value": 124 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" - } - ] - }, - { - "id": "custom.width", - "value": 81 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build_id" - }, - "properties": [ - { - "id": "custom.width", - "value": 88 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 274 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": ".*duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build id" - }, - "properties": [ - { - "id": "custom.width", - "value": 89 - }, - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "arch" - }, - "properties": [ - { - "id": "custom.width", - "value": 104 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "finished" - }, - "properties": [ - { - "id": "custom.width", - "value": 220 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "started" - }, - "properties": [ - { - "id": "custom.width", - "value": 197 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "status" - }, - "properties": [ - { - "id": "custom.width", - "value": 152 - } - ] - } - ] - }, + "collapsed": true, "gridPos": { - "h": 9, + "h": 1, "w": 24, "x": 0, - "y": 16 + "y": 51 }, - "id": 37, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "task_duration" - } - ] - }, - "pluginVersion": "9.3.2", - "targets": [ - { - "cacheDurationSeconds": 300, - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "hide": false, - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": " SELECT\n bt.id,\n bt.build_id AS \"build id\",\n bt.name,\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 task_duration\n FROM build_tasks AS bt\n JOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\n JOIN arch_enum on bt.arch_id = arch_enum.id \n WHERE $__unixEpochFilter(started_at)", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - }, + "id": 53, + "panels": [ { "datasource": { "type": "postgres", "uid": "${DS_POSTGRESQL}" }, - "editorMode": "code", - "format": "table", - "hide": true, - "rawQuery": true, - "rawSql": "SELECT\n bt.id, \n bt.build_id,\n SUM(bt.finished_at - bt.started_at) AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\nFROM build_tasks AS bt\nWHERE $__unixEpochFilter(started_at) \nGROUP BY bt.id;", - "refId": "B", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "All build tasks", - "transformations": [ - { - "id": "convertFieldType", - "options": { - "conversions": [ - { - "destinationType": "time", - "targetField": "started" + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - { - "destinationType": "time", - "targetField": "finished" - } - ], - "fields": {} - } - }, - { - "id": "joinByField", - "options": { - "byField": "id", - "mode": "outer" - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "postgres", - "uid": "${DS_POSTGRESQL}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "left", - "displayMode": "auto", - "filterable": true, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "(.*duration)|(wait time)" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "custom.width", - "value": 70 - }, - { - "id": "links", - "value": [ + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package" + }, + "properties": [ + { + "id": "custom.width", + "value": 322 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 93 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "revision" + }, + "properties": [ + { + "id": "custom.width", + "value": 62 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] } ] } ] }, - { - "matcher": { - "id": "byName", - "options": "arch" + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 62 + }, + "id": 54, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, - "properties": [ + "showHeader": true, + "sortBy": [ { - "id": "custom.width", - "value": 111 + "desc": false, + "displayName": "duration" } ] }, - { - "matcher": { - "id": "byName", - "options": "build id" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n\n" - } - ] + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" }, - { - "id": "custom.width", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 294 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "task duration" - }, - "properties": [ - { - "id": "custom.width", - "value": 100 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 25 - }, - "id": 43, - "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n DISTINCT tt.id,\n tt.build_task_id as \"build task id\",\n tt.package_fullname AS package,\n tt.revision,\n enum.value AS \"status\",\n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\nINNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n WHERE $__unixEpochFilter(tt.started_at)\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\nWHERE $__unixEpochFilter(tt.started_at);\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } ], - "show": false + "title": "Test tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started at" + }, + { + "destinationType": "time", + "targetField": "finished at" + } + ], + "fields": {} + } + } + ], + "type": "table" }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "task duration" - } - ] - }, - "pluginVersion": "9.3.2", - "targets": [ { - "cacheDurationSeconds": 300, "datasource": { "type": "postgres", "uid": "${DS_POSTGRESQL}" }, - "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], - "format": "table", - "method": "GET", - "queryParams": "", - "rawQuery": true, - "rawSql": "SELECT\n bt.id,\n bt.build_id AS \"build id\",\n bt.name,\n arch_enum.value AS arch,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n task_duration AS \"task duration\",\n web_node_duration AS \"web node duration\",\n build_node_duration AS \"build node duration\",\n task_duration - web_node_duration - build_node_duration as \"wait time\"\n FROM build_tasks AS bt\n JOIN arch_enum on bt.arch_id = arch_enum.id \n LEFT JOIN \n (\n SELECT\n bt.id,\n bt.finished_at - bt.started_at AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\n FROM build_tasks AS bt\n WHERE $__unixEpochFilter(started_at) AND status_id = 2\n GROUP BY bt.id\n ) as d\n ON bt.id = d.id\n WHERE $__unixEpochFilter(started_at) AND status_id = 2", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] } - ], - "groupBy": [ + }, + "overrides": [ { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "test task id" }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "urlPath": "" - } - ], - "title": "Completed build tasks", - "transformations": [ - { - "id": "convertFieldType", - "options": { - "conversions": [ - { - "destinationType": "time", - "targetField": "started" + "properties": [ + { + "id": "custom.width", + "value": 159 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] }, { - "destinationType": "time", - "targetField": "finished" + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package name" + }, + "properties": [ + { + "id": "custom.width", + "value": 408 + } + ] } - ], - "fields": {} - } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 69 + }, + "id": 61, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "finished" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n tss.test_task_id AS \"test task id\", \n tt.package_fullname AS \"package name\",\n enum.value AS \"step name\",\n tss.start_ts * 1000 AS started,\n tss.finish_ts * 1000 AS finished,\n tss.finish_ts - tss.start_ts AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE $__unixEpochFilter(tt.started_at);\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test steps", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" } ], - "type": "table" + "title": "Details: tests", + "type": "row" } ], "refresh": false, @@ -3994,6 +4840,6 @@ "timezone": "", "title": "Build analytics", "uid": "02mg4oxVk", - "version": 64, + "version": 84, "weekStart": "" } \ No newline at end of file diff --git a/build_analytics/grafana-dashbords/Build details.json b/build_analytics/grafana-dashbords/Build details.json index 186d752..6df780c 100644 --- a/build_analytics/grafana-dashbords/Build details.json +++ b/build_analytics/grafana-dashbords/Build details.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_ALBS_ANALYTICS", - "label": "albs_analytics", + "name": "DS_POSTGRESQL", + "label": "PostgreSQL", "description": "", "type": "datasource", "pluginId": "postgres", @@ -21,7 +21,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "9.3.6" + "version": "9.3.2" }, { "type": "panel", @@ -87,13 +87,13 @@ }, "id": 16, "panels": [], - "title": "Summary", + "title": "Builds", "type": "row" }, { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { @@ -201,13 +201,13 @@ } ] }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -266,7 +266,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { @@ -396,7 +396,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -425,7 +425,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -454,7 +454,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -483,7 +483,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -512,7 +512,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -545,7 +545,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { @@ -735,7 +735,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -764,7 +764,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -793,7 +793,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -822,7 +822,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -851,7 +851,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -884,7 +884,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "Averages for build tasks with \"completed\"\nstatus", "fieldConfig": { @@ -928,13 +928,13 @@ }, "textMode": "auto" }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -971,7 +971,7 @@ "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -1009,7 +1009,7 @@ "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -1046,7 +1046,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1079,7 +1079,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "How much time were spent in queue. \n\nStats for \"completed\" build tasks only", "fieldConfig": { @@ -1159,13 +1159,13 @@ }, "textMode": "auto" }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -1261,23 +1261,10 @@ ], "type": "stat" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 12 - }, - "id": 23, - "panels": [], - "title": "Build steps", - "type": "row" - }, { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { @@ -1423,7 +1410,7 @@ "h": 8, "w": 8, "x": 0, - "y": 13 + "y": 12 }, "id": 20, "options": { @@ -1454,7 +1441,7 @@ "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -1497,7 +1484,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1526,7 +1513,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1555,7 +1542,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1584,7 +1571,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1613,7 +1600,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1642,7 +1629,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1671,7 +1658,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1704,7 +1691,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { @@ -1735,7 +1722,7 @@ "h": 8, "w": 16, "x": 8, - "y": 13 + "y": 12 }, "id": 21, "options": { @@ -1752,13 +1739,13 @@ }, "showUnfilled": false }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -1801,7 +1788,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1830,7 +1817,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1859,7 +1846,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1888,7 +1875,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1917,7 +1904,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1946,7 +1933,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -1975,7 +1962,7 @@ { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "format": "table", @@ -2011,116 +1998,76 @@ "h": 1, "w": 24, "x": 0, - "y": 21 + "y": 20 }, - "id": 18, + "id": 27, "panels": [], - "title": "Build tasks", + "title": "Tests", "type": "row" }, { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "description": "", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "fixedColor": "blue", + "mode": "palette-classic" }, "custom": { - "align": "center", - "displayMode": "auto", - "filterable": true, - "inspect": false + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } + "mappings": [] }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "targetBlank": false, - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - } - ] + "overrides": [] }, "gridPos": { - "h": 9, - "w": 24, + "h": 6, + "w": 13, "x": 0, - "y": 22 + "y": 21 }, - "id": 2, + "id": 29, "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" - ], - "show": false + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "duration" - } - ] + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { - "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", - "fields": [ - { - "jsonPath": "" - } - ], "format": "table", - "method": "GET", - "queryParams": "", "rawQuery": true, - "rawSql": "SELECT\n bt.id,\n bt.name,\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 bt.build_id = $build_id;", + "rawSql": "SELECT \n COUNT(tt.id),\n enum.value AS status\nFROM test_tasks AS tt\nINNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\nINNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nWHERE b.id = $build_id\nGROUP BY (status);\n", "refId": "A", "sql": { "columns": [ @@ -2138,46 +2085,28 @@ } ], "limit": 50 - }, - "urlPath": "" - } - ], - "title": "All build tasks", - "transformations": [ - { - "id": "convertFieldType", - "options": { - "conversions": [ - { - "destinationType": "time", - "targetField": "started" - }, - { - "destinationType": "time", - "targetField": "finished" - } - ], - "fields": {} } } ], - "type": "table" + "title": "Tests count (group by status)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "piechart" }, { "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "displayMode": "auto", - "filterable": true, - "inspect": true + "fixedColor": "blue", + "mode": "fixed" }, "mappings": [], "thresholds": { @@ -2192,131 +2121,39 @@ "value": 80 } ] - } + }, + "unit": "s" }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "(.*duration)|(wait time)" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "custom.width", - "value": 70 - }, - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" - } - ] - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "arch" - }, - "properties": [ - { - "id": "custom.width", - "value": 111 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "build id" - }, - "properties": [ - { - "id": "links", - "value": [ - { - "title": "", - "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n\n" - } - ] - }, - { - "id": "custom.width", - "value": 102 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 75 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "task duration" - }, - "properties": [ - { - "id": "custom.width", - "value": 100 - } - ] - } - ] + "overrides": [] }, "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 31 + "h": 6, + "w": 11, + "x": 13, + "y": 21 }, - "id": 25, + "id": 31, "options": { - "footer": { - "fields": "", - "reducer": [ - "sum" + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "show": false + "fields": "", + "values": false }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "task duration" - } - ] + "textMode": "auto" }, - "pluginVersion": "9.3.6", + "pluginVersion": "9.3.2", "targets": [ { "cacheDurationSeconds": 300, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "editorMode": "code", "fields": [ @@ -2328,7 +2165,7 @@ "method": "GET", "queryParams": "", "rawQuery": true, - "rawSql": "SELECT\n bt.id,\n bt.name,\n arch_enum.value AS arch,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n task_duration AS \"task duration\",\n web_node_duration AS \"web node duration\",\n build_node_duration AS \"build node duration\",\n task_duration - web_node_duration - build_node_duration as \"wait time\"\n FROM build_tasks AS bt\n JOIN arch_enum on bt.arch_id = arch_enum.id \n LEFT JOIN \n (\n SELECT\n bt.id,\n bt.finished_at - bt.started_at AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\n FROM build_tasks AS bt\n WHERE bt.build_id = $build_id AND status_id = 2\n GROUP BY bt.id\n ) as d\n ON bt.id = d.id\n WHERE bt.build_id = $build_id AND status_id = 2", + "rawSql": "SELECT \n MAX(t.duration) AS \"MAX\",\n MIN(t.duration) AS \"MIN\",\n AVG(t.duration) AS \"AVERAGE\",\n PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY t.duration) as \"MEDIAN\",\n PERCENTILE_CONT(0.95) WITHIN GROUP(ORDER BY t.duration) as \"95TH PERCENTILE\"\nFROM\n (SELECT \n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\n FROM test_tasks AS tt\n INNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\n INNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\n INNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\n INNER JOIN builds AS b\n ON bt.build_id = b.id\n INNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n INNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\n INNER JOIN builds AS b\n ON bt.build_id = b.id\n WHERE b.id = $build_id\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\n WHERE b.id = $build_id\n ) AS t;", "refId": "A", "sql": { "columns": [ @@ -2350,26 +2187,1024 @@ "urlPath": "" } ], - "title": "Completed build tasks", - "transformations": [ - { - "id": "convertFieldType", - "options": { - "conversions": [ + "title": "Tests duration", + "type": "stat" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ { - "destinationType": "time", - "targetField": "started" + "color": "green" }, { - "destinationType": "time", - "targetField": "finished" + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 33, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n enum.value AS \"step name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nINNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nWHERE b.id = $build_id\nGROUP BY (enum.value); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" } ], - "fields": {} + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test duration (group by test step)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 8, + "x": 0, + "y": 33 + }, + "id": 35, + "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_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n aenum.value AS arch,\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN build_tasks as bt\n ON tt.build_task_id = bt.id\nINNER JOIN arch_enum as aenum\n ON bt.arch_id = aenum.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nWHERE b.id = $build_id\nGROUP BY (aenum.value); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 } } ], - "type": "table" + "title": "Tests duration (group by arch)", + "transformations": [ + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + } + ], + "type": "piechart" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 16, + "x": 8, + "y": 33 + }, + "id": 37, + "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_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n tt.package_fullname AS \"package name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nWHERE b.id = $build_id\nGROUP BY (tt.package_fullname); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Tests duration (group by package)", + "transformations": [ + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + } + ], + "type": "piechart" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 39 + }, + "id": 18, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "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": "id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "targetBlank": false, + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 2, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "duration" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT\n bt.id,\n bt.name,\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 bt.build_id = $build_id;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "All build tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true, + "inspect": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(.*duration)|(wait time)" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 70 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}\n\n" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "arch" + }, + "properties": [ + { + "id": "custom.width", + "value": 111 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}\n\n\n" + } + ] + }, + { + "id": "custom.width", + "value": 102 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 75 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "task duration" + }, + "properties": [ + { + "id": "custom.width", + "value": 100 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 25, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "task duration" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT\n bt.id,\n bt.name,\n arch_enum.value AS arch,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n task_duration AS \"task duration\",\n web_node_duration AS \"web node duration\",\n build_node_duration AS \"build node duration\",\n task_duration - web_node_duration - build_node_duration as \"wait time\"\n FROM build_tasks AS bt\n JOIN arch_enum on bt.arch_id = arch_enum.id \n LEFT JOIN \n (\n SELECT\n bt.id,\n bt.finished_at - bt.started_at AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\n FROM build_tasks AS bt\n WHERE bt.build_id = $build_id AND status_id = 2\n GROUP BY bt.id\n ) as d\n ON bt.id = d.id\n WHERE bt.build_id = $build_id AND status_id = 2", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Completed build tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + } + ], + "title": "Details: build tasks", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 40 + }, + "id": 39, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "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": "package" + }, + "properties": [ + { + "id": "custom.width", + "value": 322 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 93 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "revision" + }, + "properties": [ + { + "id": "custom.width", + "value": 62 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "build task id" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 41, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "duration" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n DISTINCT tt.id,\n tt.build_task_id as \"build task id\",\n tt.package_fullname AS package,\n tt.revision,\n enum.value AS \"status\",\n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\nINNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nINNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n INNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\n INNER JOIN builds AS b\n ON bt.build_id = b.id\n WHERE b.id = $build_id\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\nWHERE b.id = $build_id;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started at" + }, + { + "destinationType": "time", + "targetField": "finished at" + } + ], + "fields": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "test task id" + }, + "properties": [ + { + "id": "custom.width", + "value": 159 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package name" + }, + "properties": [ + { + "id": "custom.width", + "value": 408 + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 43, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "finished" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n tss.test_task_id AS \"test task id\", \n tt.package_fullname AS \"package name\",\n enum.value AS \"step name\",\n tss.start_ts * 1000 AS started,\n tss.finish_ts * 1000 AS finished,\n tss.finish_ts - tss.start_ts AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nINNER JOIN build_tasks AS bt\n ON tt.build_task_id = bt.id\nINNER JOIN builds AS b\n ON bt.build_id = b.id\nWHERE b.id = $build_id\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test steps", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + } + ], + "title": "Details: tests", + "type": "row" } ], "refresh": false, @@ -2382,7 +3217,7 @@ "current": {}, "datasource": { "type": "postgres", - "uid": "${DS_ALBS_ANALYTICS}" + "uid": "${DS_POSTGRESQL}" }, "definition": "SELECT id\nFROM builds\nORDER BY id DESC", "hide": 0, @@ -2407,6 +3242,6 @@ "timezone": "", "title": "Build details", "uid": "dmVtrz-4k", - "version": 5, + "version": 34, "weekStart": "" } \ No newline at end of file diff --git a/build_analytics/grafana-dashbords/Build task details.json b/build_analytics/grafana-dashbords/Build task details.json index 2249199..20b5c71 100644 --- a/build_analytics/grafana-dashbords/Build task details.json +++ b/build_analytics/grafana-dashbords/Build task details.json @@ -35,6 +35,12 @@ "name": "Grafana", "version": "9.3.2" }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, { "type": "datasource", "id": "postgres", @@ -77,6 +83,17 @@ "links": [], "liveNow": false, "panels": [ + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 28, + "title": "Build task", + "type": "row" + }, { "datasource": { "type": "postgres", @@ -143,7 +160,7 @@ "h": 3, "w": 24, "x": 0, - "y": 0 + "y": 1 }, "id": 5, "options": { @@ -196,7 +213,7 @@ "urlPath": "" } ], - "title": "Task summary", + "title": "Build task", "transformations": [ { "id": "convertFieldType", @@ -259,10 +276,10 @@ ] }, "gridPos": { - "h": 9, + "h": 8, "w": 24, "x": 0, - "y": 3 + "y": 4 }, "id": 12, "options": { @@ -629,14 +646,219 @@ "type": "bargauge" }, { - "collapsed": true, + "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 12 }, - "id": 8, + "id": 22, + "panels": [], + "title": "Test tasks", + "type": "row" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 11, + "x": 0, + "y": 13 + }, + "id": 24, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n enum.value AS \"step name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE tt.build_task_id = $build_task\nGROUP BY (enum.value); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test duration (group by test step)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 13, + "x": 11, + "y": 13 + }, + "id": 18, + "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_POSTGRESQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n tt.package_fullname AS \"package name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nWHERE tt.build_task_id = $build_task\nGROUP BY (tt.package_fullname); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Tests duration (group by package)", + "transformations": [ + { + "id": "rowsToFields", + "options": { + "mappings": [] + } + } + ], + "type": "piechart" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 20, "panels": [ { "datasource": { @@ -650,7 +872,7 @@ "mode": "thresholds" }, "custom": { - "align": "auto", + "align": "left", "displayMode": "auto", "filterable": true, "inspect": true @@ -712,7 +934,7 @@ "h": 5, "w": 24, "x": 0, - "y": 13 + "y": 22 }, "id": 2, "options": { @@ -750,7 +972,7 @@ "method": "GET", "queryParams": "", "rawQuery": true, - "rawSql": "SELECT \n enum.value,\n stats.start_ts * 1000 AS started,\n stats.end_ts * 1000 AS finished,\n stats.end_ts - stats.start_ts AS duration\nFROM web_node_stats AS stats\nINNER JOIN web_node_stats_enum AS enum\n ON stats.stat_name_id = enum.id\nWHERE build_task_id = $build_task", + "rawSql": "SELECT \n enum.value as step,\n stats.start_ts * 1000 AS started,\n stats.end_ts * 1000 AS finished,\n stats.end_ts - stats.start_ts AS duration\nFROM web_node_stats AS stats\nINNER JOIN web_node_stats_enum AS enum\n ON stats.stat_name_id = enum.id\nWHERE build_task_id = $build_task", "refId": "web node stats", "sql": { "columns": [ @@ -805,7 +1027,7 @@ "mode": "thresholds" }, "custom": { - "align": "auto", + "align": "left", "displayMode": "auto", "filterable": true, "inspect": true @@ -852,10 +1074,10 @@ ] }, "gridPos": { - "h": 11, + "h": 8, "w": 24, "x": 0, - "y": 18 + "y": 27 }, "id": 3, "options": { @@ -893,7 +1115,7 @@ "method": "GET", "queryParams": "", "rawQuery": true, - "rawSql": "SELECT enum.value,\n stats.start_ts * 1000 AS started,\n stats.end_ts * 1000 AS finished,\n stats.end_ts - stats.start_ts AS duration\nFROM build_node_stats AS stats\nINNER JOIN build_node_stats_enum AS enum\n ON stats.stat_name_id = enum.id\nWHERE build_task_id = $build_task", + "rawSql": "SELECT enum.value AS step,\n stats.start_ts * 1000 AS started,\n stats.end_ts * 1000 AS finished,\n stats.end_ts - stats.start_ts AS duration\nFROM build_node_stats AS stats\nINNER JOIN build_node_stats_enum AS enum\n ON stats.stat_name_id = enum.id\nWHERE build_task_id = $build_task", "refId": "web node stats", "sql": { "columns": [ @@ -937,7 +1159,357 @@ "type": "table" } ], - "title": "Details", + "title": "Details: build task", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 30, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "package" + }, + "properties": [ + { + "id": "custom.width", + "value": 389 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 72 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "revision" + }, + "properties": [ + { + "id": "custom.width", + "value": 119 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 26, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "id" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n DISTINCT tt.id,\n tt.package_fullname AS package,\n tt.revision,\n enum.value AS \"status\",\n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\nINNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n WHERE tt.build_task_id = $build_task\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\nWHERE tt.build_task_id = $build_task; ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test tasks", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started at" + }, + { + "destinationType": "time", + "targetField": "finished at" + } + ], + "fields": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "test task id" + }, + "properties": [ + { + "id": "custom.width", + "value": 159 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package name" + }, + "properties": [ + { + "id": "custom.width", + "value": 408 + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 16, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "finished" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n tt.package_fullname AS \"package name\",\n tss.test_task_id AS \"test task id\", \n enum.value AS \"step name\",\n tss.start_ts * 1000 AS started,\n tss.finish_ts * 1000 AS finished,\n tss.finish_ts - tss.start_ts AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE tt.build_task_id = $build_task; ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test steps", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + } + ], + "title": "Details: test tasks", "type": "row" } ], @@ -975,6 +1547,6 @@ "timezone": "", "title": "Build task details", "uid": "vtQClqxVk", - "version": 37, + "version": 61, "weekStart": "" } \ No newline at end of file diff --git a/build_analytics/grafana-dashbords/Test task details.json b/build_analytics/grafana-dashbords/Test task details.json new file mode 100644 index 0000000..2568011 --- /dev/null +++ b/build_analytics/grafana-dashbords/Test task details.json @@ -0,0 +1,516 @@ +{ + "__inputs": [ + { + "name": "DS_POSTGRESQL", + "label": "PostgreSQL", + "description": "", + "type": "datasource", + "pluginId": "postgres", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.3.2" + }, + { + "type": "datasource", + "id": "postgres", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "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": [ + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package" + }, + "properties": [ + { + "id": "custom.width", + "value": 253 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "id" + }, + "properties": [ + { + "id": "custom.width", + "value": 80 + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n DISTINCT tt.id,\n tt.package_fullname AS package,\n tt.revision,\n enum.value AS \"status\",\n tt.started_at * 1000 AS \"started at\",\n tf.finished_at * 1000 AS \"finished at\", \n tf.finished_at - tt.started_at AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_tasks_status_enum AS enum\n ON tt.status_id = enum.id\nINNER JOIN \n (SELECT \n tss.test_task_id, \n MAX(tss.finish_ts) AS finished_at \n FROM test_steps_stats AS tss\n INNER JOIN test_tasks AS tt\n ON tss.test_task_id = tt.id\n WHERE tt.id = $id\n GROUP BY tss.test_task_id) AS tf\n ON tf.test_task_id = tt.id\nWHERE tt.id = $id;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Task info", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started at" + }, + { + "destinationType": "time", + "targetField": "finished at" + } + ], + "fields": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 8, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n enum.value AS \"step name\",\n SUM(tss.finish_ts - tss.start_ts) AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE tt.id = $id\nGROUP BY (enum.value); ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test duration (group by test step)", + "transformations": [ + { + "id": "rowsToFields", + "options": {} + } + ], + "type": "bargauge" + }, + { + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "test task id" + }, + "properties": [ + { + "id": "custom.width", + "value": 159 + }, + { + "id": "links", + "value": [ + { + "title": "", + "url": "/d/8nFXlkB4z/test-task-details?orgId=1&var-id=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "package name" + }, + "properties": [ + { + "id": "custom.width", + "value": 408 + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 6, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "finished" + } + ] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "editorMode": "code", + "fields": [ + { + "jsonPath": "" + } + ], + "format": "table", + "method": "GET", + "queryParams": "", + "rawQuery": true, + "rawSql": "SELECT \n tt.package_fullname AS \"package name\",\n tss.test_task_id AS \"test task id\", \n enum.value AS \"step name\",\n tss.start_ts * 1000 AS started,\n tss.finish_ts * 1000 AS finished,\n tss.finish_ts - tss.start_ts AS duration\nFROM test_tasks AS tt\nINNER JOIN test_steps_stats AS tss\n ON tt.id = tss.test_task_id\nINNER JOIN test_steps_enum AS enum\n ON tss.stat_name_id = enum.id\nWHERE tt.id = $id", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "urlPath": "" + } + ], + "title": "Test steps", + "transformations": [ + { + "id": "convertFieldType", + "options": { + "conversions": [ + { + "destinationType": "time", + "targetField": "started" + }, + { + "destinationType": "time", + "targetField": "finished" + } + ], + "fields": {} + } + } + ], + "type": "table" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "postgres", + "uid": "${DS_POSTGRESQL}" + }, + "definition": "SELECT id\nFROM test_tasks\nORDER BY id DESC", + "hide": 0, + "includeAll": false, + "label": "Test task id", + "multi": false, + "name": "id", + "options": [], + "query": "SELECT id\nFROM test_tasks\nORDER BY id DESC", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Test task details", + "uid": "8nFXlkB4z", + "version": 8, + "weekStart": "" +} \ No newline at end of file