diff --git a/grafana/dashboards/AzureDevOps.json b/grafana/dashboards/AzureDevOps.json index 38e416180fd..6d3507779b5 100644 --- a/grafana/dashboards/AzureDevOps.json +++ b/grafana/dashboards/AzureDevOps.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 7, + "id": 20, "links": [], "liveNow": false, "panels": [ @@ -103,15 +103,12 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] - } + }, + "unit": "short" }, "overrides": [] }, @@ -195,7 +192,7 @@ ] } ], - "title": "1.1 Number of New Pull Requests [Selected Time Range]", + "title": "1.1 Number of New Pull Requests", "type": "stat" }, { @@ -232,17 +229,29 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Pull Request Count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -267,7 +276,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -292,7 +301,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -333,7 +342,7 @@ ] } ], - "title": "1.2 Total Number of New Pull Requests [Each Month]", + "title": "1.2 Number of New Pull Requests", "type": "barchart" }, { @@ -406,7 +415,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -519,7 +528,7 @@ }, { "color": "red", - "value": 80 + "value": 0.05 } ] }, @@ -587,7 +596,7 @@ ] } ], - "title": "2.1 Ratio of Non-merging Pull Requests of All Closed or Merged PRs", + "title": "2.1 Ratio of unmerged Pull Requests of All Closed or Merged PRs", "type": "stat" }, { @@ -601,29 +610,19 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pull Request Count", + "axisLabel": "", "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 4, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, "thresholdsStyle": { "mode": "off" } @@ -639,7 +638,53 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "PR: Open" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed without merging" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed and merged" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -656,29 +701,40 @@ } ], "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, "legend": { - "calcs": [ - "sum" - ], + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 + }, "tooltip": { - "mode": "multi", + "mode": "single", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", - "format": "time_series", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as \"PR: Open\",\n count(distinct case when status = 'CLOSED' then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status = 'MERGED' then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nwith _prs as (\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as open,\n count(distinct case when status = 'CLOSED' then id else null end) as closed,\n count(distinct case when status = 'MERGED' then id else null end) as merged\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n open as \"PR: Open\",\n closed as \"PR: Closed without merging\",\n merged as \"PR: Closed and merged\"\nFROM _prs\nORDER BY time", "refId": "A", "select": [ [ @@ -690,6 +746,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -702,8 +775,8 @@ ] } ], - "title": "2.2 Pull Request Status Distribution [Each Month]", - "type": "timeseries" + "title": "2.2 Pull Request Status Distribution", + "type": "barchart" }, { "datasource": "mysql", @@ -717,13 +790,9 @@ "thresholds": { "mode": "absolute", "steps": [ - { - "color": "green", - "value": null - }, { "color": "red", - "value": 80 + "value": null } ] } @@ -889,7 +958,7 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "tooltip": { "mode": "multi", @@ -900,12 +969,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('MERGED', 'CLOSED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('MERGED', 'CLOSED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", "refId": "A", "select": [ [ @@ -917,6 +987,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -929,7 +1016,7 @@ ] } ], - "title": "2.4 Ratio of Non-merging PRs of All Closed or Merged PRs [Each Month]", + "title": "2.4 Ratio of unmerged PRs of All Closed or Merged PRs", "type": "timeseries" }, { @@ -950,10 +1037,11 @@ }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1019,7 +1107,7 @@ ] } ], - "title": "2.5 Mean Time to Merge of Pull Requests in Days [Selected Time Range]", + "title": "2.5 Mean Time to Merge of Pull Requests", "type": "stat" }, { @@ -1061,10 +1149,11 @@ }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1091,7 +1180,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1110,12 +1199,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1127,6 +1217,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1139,50 +1246,16 @@ ] } ], - "title": "2.6 Mean Time to Merge of Pull Requests in Days [Each Month]", + "title": "2.6 Mean Time to Merge of Pull Requests", "type": "barchart" }, - { - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "gridPos": { - "h": 2, - "w": 24, - "x": 0, - "y": 35 - }, - "id": 99, - "options": { - "code": { - "language": "plaintext", - "showLineNumbers": false, - "showMiniMap": false - }, - "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", - "mode": "markdown" - }, - "pluginVersion": "9.5.15", - "targets": [ - { - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "queryType": "randomWalk", - "refId": "A" - } - ], - "type": "text" - }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 35 }, "id": 102, "panels": [], @@ -1203,7 +1276,8 @@ "value": null } ] - } + }, + "unit": "short" }, "overrides": [] }, @@ -1211,7 +1285,7 @@ "h": 6, "w": 6, "x": 0, - "y": 38 + "y": 36 }, "id": 103, "links": [ @@ -1245,7 +1319,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -1286,7 +1360,7 @@ ] } ], - "title": "3.1 Total Number of Successful Pipeline runs [Selected Time Range]", + "title": "3.1 Number of Successful Pipeline runs", "type": "stat" }, { @@ -1301,8 +1375,12 @@ "mode": "absolute", "steps": [ { - "color": "blue", + "color": "red", "value": null + }, + { + "color": "green", + "value": 0.9 } ] }, @@ -1314,7 +1392,7 @@ "h": 6, "w": 6, "x": 6, - "y": 38 + "y": 36 }, "id": 104, "links": [ @@ -1348,7 +1426,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -1389,7 +1467,7 @@ ] } ], - "title": "3.2 Mean Pipeline runs Success Rate", + "title": "3.2 Mean Pipeline runs Success Rate %", "type": "stat" }, { @@ -1398,49 +1476,48 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "fixed" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" } }, - "decimals": 0, "mappings": [], - "unit": "none" + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "build_count", - "ABORT" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - }, { "matcher": { "id": "byName", - "options": "SUCCESS" + "options": "successful_count" }, "properties": [ { @@ -1455,7 +1532,7 @@ { "matcher": { "id": "byName", - "options": "FAILURE" + "options": "failed_count" }, "properties": [ { @@ -1466,31 +1543,16 @@ } } ] - }, - { - "matcher": { - "id": "byName", - "options": "ABORT" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "rgba(205, 204, 206, 1)", - "mode": "fixed" - } - } - ] } ] }, "gridPos": { "h": 6, - "w": 6, + "w": 12, "x": 12, - "y": 38 + "y": 36 }, - "id": 105, + "id": 110, "links": [ { "targetBlank": true, @@ -1499,32 +1561,28 @@ } ], "options": { - "displayLabels": [ - "value", - "percent" - ], + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.25, "legend": { "calcs": [], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "percent", - "value" - ] + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": true + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 }, "tooltip": { - "mode": "single", + "mode": "multi", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ @@ -1533,15 +1591,16 @@ "editorMode": "code", "format": "table", "group": [], + "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", + "rawSql": "with _builds as (\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n successful_count,\n failed_count\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ { "params": [ - "project_id" + "id" ], "type": "column" } @@ -1564,8 +1623,8 @@ ], "limit": 50 }, - "table": "gitlab_commits", - "timeColumn": "created_at", + "table": "ae_projects", + "timeColumn": "ae_create_time", "timeColumnType": "timestamp", "where": [ { @@ -1576,58 +1635,144 @@ ] } ], - "title": "3.3 Total Pipeline runs Result Distribution", - "type": "piechart" + "title": "3.3 Number of successful and failed pipeline runs", + "type": "barchart" }, { "datasource": "mysql", "description": "Number of successful Pipeline runs / Number of total Pipeline runs", "fieldConfig": { "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "decimals": 0, "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ + "unit": "none" + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "build_count", + "ABORT" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ { - "color": "light-orange", - "value": null + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } } ] }, - "unit": "none" - }, - "overrides": [] + { + "matcher": { + "id": "byName", + "options": "SUCCESS" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "FAILURE" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ABORT" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgba(205, 204, 206, 1)", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, "w": 6, - "x": 18, - "y": 38 + "x": 0, + "y": 42 }, - "id": 106, + "id": 105, "links": [ { "targetBlank": true, - "title": "Build Duration", - "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" + "title": "Build Count", + "url": "https://devlake.apache.org/docs/Metrics/BuildCount" } ], "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { + "displayLabels": [ + "value", + "percent" + ], + "legend": { "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "sum" + ], "fields": "", - "values": false + "values": true }, - "text": {}, - "textMode": "auto" + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "9.5.15", + "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", @@ -1636,7 +1781,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n IF(result = '', 'Unknown', result) as result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", "refId": "A", "select": [ [ @@ -1677,12 +1822,12 @@ ] } ], - "title": "3.4 Mean Pipeline runs Duration in Minutes", - "type": "stat" + "title": "3.4 Total Pipeline runs Result Distribution", + "type": "piechart" }, { "datasource": "mysql", - "description": "", + "description": "1. Mean Pipeline Runs success rate over time.\n2. The Pipeline runs being calculated are filtered by \"workflow runs starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)", "fieldConfig": { "defaults": { "color": { @@ -1691,7 +1836,7 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pipeline runs Count", + "axisLabel": "Rate(%)", "axisPlacement": "auto", "axisSoftMin": 0, "fillOpacity": 80, @@ -1706,7 +1851,7 @@ "type": "linear" }, "thresholdsStyle": { - "mode": "off" + "mode": "line" } }, "mappings": [], @@ -1719,25 +1864,27 @@ }, { "color": "red", - "value": 80 + "value": 0.9 } ] - } + }, + "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 6, - "w": 12, - "x": 0, - "y": 44 + "w": 18, + "x": 6, + "y": 42 }, - "id": 107, + "id": 112, + "interval": "", "links": [ { "targetBlank": true, - "title": "Build Count", - "url": "https://devlake.apache.org/docs/Metrics/BuildCount" + "title": "Build Success Rate", + "url": "https://devlake.apache.org/docs/Metrics/BuildSuccessRate" } ], "options": { @@ -1746,10 +1893,12 @@ "fullHighlight": false, "groupWidth": 0.7, "legend": { - "calcs": [], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1761,7 +1910,7 @@ "mode": "single", "sort": "none" }, - "xTickLabelRotation": 0, + "xTickLabelRotation": 45, "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", @@ -1771,16 +1920,15 @@ "editorMode": "code", "format": "table", "group": [], - "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Pipeline runs Count\"\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n -- and id like \"%azure%\"\r\n and cicd_scope_id in (${repo_id})\r\n -- Enable the following condition to remove the month with incomplete data\r\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%m/%Y') else concat('W', date_format(time,'%u %Y')) end as _time,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Pipeline Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", "refId": "A", "select": [ [ { "params": [ - "id" + "progress" ], "type": "column" } @@ -1803,8 +1951,8 @@ ], "limit": 50 }, - "table": "ae_projects", - "timeColumn": "ae_create_time", + "table": "ca_analysis", + "timeColumn": "create_time", "timeColumnType": "timestamp", "where": [ { @@ -1815,7 +1963,7 @@ ] } ], - "title": "3.1.1 Total Number of Successful Pipeline runs [Each Month]", + "title": "3.5 Pipeline run success rate %", "type": "barchart" }, { @@ -1823,106 +1971,50 @@ "description": "1. Mean Pipeline runs success rate over time.\n2. The Pipeline runs being calculated are filtered by \"Pipeline runs starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Pipeline runs Success Rate(%)", - "axisPlacement": "auto", - "axisSoftMin": 0, - "fillOpacity": 80, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "off" - } - }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green", + "color": "light-orange", "value": null - }, - { - "color": "red", - "value": 80 } ] }, - "unit": "percentunit" + "unit": "m" }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Pipeline runs Success Rate" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - } - ] + "overrides": [] }, "gridPos": { "h": 6, - "w": 12, - "x": 12, - "y": 44 + "w": 6, + "x": 0, + "y": 48 }, - "id": 108, - "interval": "", + "id": 106, "links": [ { "targetBlank": true, - "title": "Build Success Rate", - "url": "https://devlake.apache.org/docs/Metrics/BuildSuccessRate" + "title": "Build Duration", + "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" } ], "options": { - "barRadius": 0, - "barWidth": 0.5, - "fullHighlight": false, - "groupWidth": 0.7, - "legend": { - "calcs": [ - "mean" - ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", "orientation": "auto", - "showValue": "auto", - "stacking": "none", - "text": { - "valueSize": 12 - }, - "tooltip": { - "mode": "single", - "sort": "none" + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 + "text": {}, + "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1931,13 +2023,13 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%azure%\"\r\n and cicd_scope_id in (${repo_id})\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Pipeline runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ { "params": [ - "progress" + "project_id" ], "type": "column" } @@ -1960,8 +2052,8 @@ ], "limit": 50 }, - "table": "ca_analysis", - "timeColumn": "create_time", + "table": "gitlab_commits", + "timeColumn": "created_at", "timeColumnType": "timestamp", "where": [ { @@ -1972,8 +2064,8 @@ ] } ], - "title": "3.2.1 Pipeline runs Success Rate [Each Month]", - "type": "barchart" + "title": "3.6 Mean Pipeline runs Duration in Minutes", + "type": "stat" }, { "datasource": "mysql", @@ -1986,7 +2078,7 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pipeline runs Duration(minutes)", + "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "fillOpacity": 80, @@ -2017,13 +2109,14 @@ "value": 60 } ] - } + }, + "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", - "options": "mean_duration_minutes" + "options": "mean_duration_sec" }, "properties": [ { @@ -2039,11 +2132,11 @@ }, "gridPos": { "h": 6, - "w": 24, - "x": 0, - "y": 50 + "w": 18, + "x": 6, + "y": 48 }, - "id": 109, + "id": 111, "links": [ { "targetBlank": true, @@ -2053,14 +2146,14 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -2069,7 +2162,7 @@ "valueSize": 12 }, "tooltip": { - "mode": "single", + "mode": "multi", "sort": "none" }, "xTickLabelRotation": 0, @@ -2085,7 +2178,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n mean_duration_sec/60 as mean_duration_minutes\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n -- and id like \"%azure%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n mean_duration_sec\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ @@ -2126,8 +2219,42 @@ ] } ], - "title": "3.4.1 Mean Pipeline runs Duration in Minutes [Each Month]", + "title": "3.7 Mean pipeline run duration", "type": "barchart" + }, + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "gridPos": { + "h": 2, + "w": 24, + "x": 0, + "y": 54 + }, + "id": 99, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", + "mode": "markdown" + }, + "pluginVersion": "9.5.15", + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "queryType": "randomWalk", + "refId": "A" + } + ], + "type": "text" } ], "refresh": "", @@ -2163,6 +2290,34 @@ "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "current": { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + "hide": 0, + "includeAll": false, + "label": "Time Interval", + "multi": false, + "name": "interval", + "options": [ + { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + { + "selected": false, + "text": "Week", + "value": "WEEKDAY" + } + ], + "query": "Month : DAYOFMONTH, Week : WEEKDAY", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" } ] }, @@ -2174,6 +2329,6 @@ "timezone": "", "title": "Azure DevOps", "uid": "ba7e3a95-80ed-4067-a54b-2a82758eb3dd", - "version": 3, + "version": 5, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/BitBucket.json b/grafana/dashboards/BitBucket.json index dc0117b1c12..68219a37f13 100644 --- a/grafana/dashboards/BitBucket.json +++ b/grafana/dashboards/BitBucket.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 3, + "id": 21, "links": [], "liveNow": false, "panels": [ @@ -47,7 +47,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "- Use Cases: This dashboard shows the basic Git and Code Review metrics from BitBucket.\n- Data Source Required: BitBucket", + "content": "- Use Cases: This dashboard shows the basic Git and Code Review metrics from Bitbucket.\n- Data Source Required: Bitbucket Cloud or Server/data center", "mode": "markdown" }, "pluginVersion": "9.5.15", @@ -103,7 +103,7 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null }, { @@ -195,7 +195,7 @@ ] } ], - "title": "1.1 Number of New Pull Requests [Selected Time Range]", + "title": "1.1 Number of New Pull Requests", "type": "stat" }, { @@ -232,17 +232,29 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Pull Request Count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -260,14 +272,14 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -292,7 +304,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -333,7 +345,7 @@ ] } ], - "title": "1.2 Total Number of New Pull Requests [Each Month]", + "title": "1.2 Number of New Pull Requests", "type": "barchart" }, { @@ -399,14 +411,14 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -472,7 +484,7 @@ ] } ], - "title": "1.3 Top Contributors By Merged PRs", + "title": "1.3 Top 20 Contributors By Merged PRs", "type": "barchart" }, { @@ -519,7 +531,7 @@ }, { "color": "red", - "value": 80 + "value": 0.05 } ] }, @@ -587,7 +599,7 @@ ] } ], - "title": "2.1 Ratio of Non-merging Pull Requests of All Closed or Merged PRs", + "title": "2.1 Ratio of unmerged Pull Requests of All Closed or Merged PRs", "type": "stat" }, { @@ -601,29 +613,19 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pull Request Count", + "axisLabel": "", "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 4, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, "thresholdsStyle": { "mode": "off" } @@ -639,7 +641,53 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "PR: Open" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed without merging" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed and merged" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -656,29 +704,37 @@ } ], "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, "legend": { - "calcs": [ - "sum" - ], + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", "tooltip": { - "mode": "multi", + "mode": "single", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", - "format": "time_series", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as \"PR: Open\",\n count(distinct case when status = 'CLOSED' then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status = 'MERGED' then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\n with _prs as (\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as open,\n count(distinct case when status = 'CLOSED' then id else null end) as closed,\n count(distinct case when status = 'MERGED' then id else null end) as merged\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n open as \"PR: Open\",\n closed as \"PR: Closed without merging\",\n merged as \"PR: Closed and merged\"\nFROM _prs\nORDER BY time", "refId": "A", "select": [ [ @@ -690,6 +746,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -702,8 +775,8 @@ ] } ], - "title": "2.2 Pull Request Status Distribution [Each Month]", - "type": "timeseries" + "title": "2.2 Pull Request Status Distribution", + "type": "barchart" }, { "datasource": "mysql", @@ -717,12 +790,9 @@ "thresholds": { "mode": "absolute", "steps": [ - { - "color": "green" - }, { "color": "red", - "value": 80 + "value": null } ] } @@ -839,7 +909,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 4, + "pointSize": 10, "scaleDistribution": { "type": "linear" }, @@ -858,7 +928,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -887,7 +958,7 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "tooltip": { "mode": "multi", @@ -898,12 +969,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('MERGED', 'CLOSED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('MERGED', 'CLOSED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", "refId": "A", "select": [ [ @@ -915,6 +987,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -927,7 +1016,7 @@ ] } ], - "title": "2.4 Ratio of Non-merging PRs of All Closed or Merged PRs [Each Month]", + "title": "2.4 Ratio of Non-merging PRs of All Closed or Merged PRs", "type": "timeseries" }, { @@ -943,14 +1032,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1016,7 +1107,7 @@ ] } ], - "title": "2.5 Mean Time to Merge of Pull Requests in Days [Selected Time Range]", + "title": "2.5 Mean Time to Merge of Pull Requests", "type": "stat" }, { @@ -1053,14 +1144,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1087,7 +1180,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1106,12 +1199,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1123,6 +1217,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1135,7 +1246,7 @@ ] } ], - "title": "2.6 Mean Time to Merge of Pull Requests in Days [Each Month]", + "title": "2.6 Mean Time to Merge of Pull Requests", "type": "barchart" }, { @@ -1206,6 +1317,34 @@ "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "current": { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + "hide": 0, + "includeAll": false, + "label": "Time Interval", + "multi": false, + "name": "interval", + "options": [ + { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + { + "selected": false, + "text": "Week", + "value": "WEEKDAY" + } + ], + "query": "Month : DAYOFMONTH, Week : WEEKDAY", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" } ] }, @@ -1217,6 +1356,6 @@ "timezone": "", "title": "Bitbucket", "uid": "4LzQHZa4k", - "version": 3, + "version": 5, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/GitHub.json b/grafana/dashboards/GitHub.json index 437b1cb852d..a158f15eaee 100644 --- a/grafana/dashboards/GitHub.json +++ b/grafana/dashboards/GitHub.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 14, + "id": 35, "links": [], "liveNow": false, "panels": [ @@ -103,12 +103,8 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } @@ -148,6 +144,7 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, @@ -165,6 +162,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -177,16 +191,16 @@ ] } ], - "title": "1.1 Number of New Issues [Selected Time Range]", + "title": "1.1 Number of New Issues", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, "custom": { "axisCenteredZero": false, @@ -214,12 +228,8 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } @@ -242,7 +252,7 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { @@ -251,7 +261,7 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -270,12 +280,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _issues as(\n SELECT\n DATE_ADD(date(i.created_date), INTERVAL -DAY(date(i.created_date))+1 DAY) as time,\n count(distinct i.id) as issue_count\n FROM issues i\n \tjoin board_issues bi on i.id = bi.issue_id\n \tjoin boards b on bi.board_id = b.id\n WHERE\n $__timeFilter(i.created_date)\n and i.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and b.id in (${repo_id})\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n issue_count as \"Issue Count\"\nFROM _issues\nORDER BY time\n", + "rawSql": "with _issues as(\n SELECT\n DATE_ADD(date(i.created_date), INTERVAL -$interval(date(i.created_date))+1 DAY) as time,\n count(distinct i.id) as issue_count\n FROM issues i\n \tjoin board_issues bi on i.id = bi.issue_id\n \tjoin boards b on bi.board_id = b.id\n WHERE\n $__timeFilter(i.created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and i.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and b.id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n issue_count as \"Issue Count\"\nFROM _issues\nORDER BY time\n", "refId": "A", "select": [ [ @@ -287,6 +298,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -299,7 +327,7 @@ ] } ], - "title": "1.2 Number of New Issues [Each Month]", + "title": "1.2 Number of New Issues", "type": "barchart" }, { @@ -343,10 +371,6 @@ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] } @@ -415,12 +439,12 @@ ] } ], - "title": "2.1 Number of Closed Issues [Issues Created in Selected Time Range]", + "title": "2.1 Number of Closed Issues", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -429,29 +453,19 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Issue Count", + "axisLabel": "", "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 4, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, "thresholdsStyle": { "mode": "off" } @@ -481,7 +495,7 @@ { "id": "color", "value": { - "fixedColor": "orange", + "fixedColor": "green", "mode": "fixed" } } @@ -495,7 +509,7 @@ "x": 7, "y": 11 }, - "id": 76, + "id": 111, "links": [ { "targetBlank": true, @@ -504,29 +518,40 @@ } ], "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, "legend": { - "calcs": [ - "sum" - ], + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 + }, "tooltip": { - "mode": "multi", + "mode": "single", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", - "format": "time_series", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n DATE_ADD(date(i.created_date), INTERVAL -DAYOFMONTH(date(i.created_date))+1 DAY) as time,\n count(distinct case when status != 'DONE' then i.id else null end) as open_issue_count,\n count(distinct case when status = 'DONE' then i.id else null end) as closed_issue_count\nFROM issues i\n\tjoin board_issues bi on i.id = bi.issue_id\n\tjoin boards b on bi.board_id = b.id\nWHERE\n $__timeFilter(i.created_date)\n and i.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and b.id in (${repo_id})\ngroup by 1\n", + "rawSql": "with _issues as(\n SELECT\n DATE_ADD(date(i.created_date), INTERVAL -$interval(date(i.created_date))+1 DAY) as time,\n count(distinct case when status != 'DONE' then i.id else null end) as open_issue_count,\n count(distinct case when status = 'DONE' then i.id else null end) as closed_issue_count\n FROM issues i\n join board_issues bi on i.id = bi.issue_id\n join boards b on bi.board_id = b.id\n WHERE\n $__timeFilter(i.created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and i.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and b.id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n open_issue_count,\n closed_issue_count\nFROM _issues\nORDER BY time", "refId": "A", "select": [ [ @@ -538,6 +563,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -550,8 +592,8 @@ ] } ], - "title": "2.2 Number of Open and Closed Issues [Issues Created in Each Month]", - "type": "timeseries" + "title": "2.2 Number of open and closed issues by Issue creation time", + "type": "barchart" }, { "datasource": "mysql", @@ -574,7 +616,8 @@ "value": 14 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -640,12 +683,12 @@ ] } ], - "title": "2.3 Mean Issue Lead Time in Days [Issues Closed in Selected Time Range]", + "title": "2.3 Mean Issue Lead Time by issue resolution time", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -685,7 +728,8 @@ "value": 80 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -705,14 +749,14 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -731,12 +775,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _issues as(\n SELECT\n DATE_ADD(date(i.resolution_date), INTERVAL -DAY(date(i.resolution_date))+1 DAY) as time,\n AVG(i.lead_time_minutes/1440) as issue_lead_time\n FROM issues i\n \tjoin board_issues bi on i.id = bi.issue_id\n \tjoin boards b on bi.board_id = b.id\n WHERE\n b.id in (${repo_id})\n and i.status = \"DONE\"\n and $__timeFilter(i.resolution_date)\n and i.resolution_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n issue_lead_time as \"Mean Issue Lead Time in Days\"\nFROM _issues\nORDER BY time\n", + "rawSql": "with _issues as(\n SELECT\n DATE_ADD(date(i.resolution_date), INTERVAL -$interval(date(i.resolution_date))+1 DAY) as time,\n AVG(i.lead_time_minutes/1440) as issue_lead_time\n FROM issues i\n \tjoin board_issues bi on i.id = bi.issue_id\n \tjoin boards b on bi.board_id = b.id\n WHERE\n b.id in (${repo_id})\n and i.status = \"DONE\"\n and $__timeFilter(i.resolution_date)\n and i.resolution_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n issue_lead_time as \"Mean Issue Lead Time in Days\"\nFROM _issues\nORDER BY time\n", "refId": "A", "select": [ [ @@ -748,6 +793,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -760,12 +822,12 @@ ] } ], - "title": "2.4 Mean Issue Lead Time in Days [Issues Closed in Each Month]", + "title": "2.4 Mean issue lead time by issue resolution time", "type": "barchart" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -774,7 +836,7 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Queue Time (Days)", + "axisLabel": "Queue Time", "axisPlacement": "auto", "axisSoftMin": 0, "fillOpacity": 100, @@ -797,7 +859,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -805,7 +868,7 @@ } ] }, - "unit": "none" + "unit": "d" }, "overrides": [] }, @@ -819,7 +882,7 @@ "links": [], "options": { "barRadius": 0, - "barWidth": 0.1, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { @@ -828,12 +891,14 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", "stacking": "none", - "text": {}, + "text": { + "valueSize": 12 + }, "tooltip": { "mode": "multi", "sort": "none" @@ -851,7 +916,7 @@ "metricColumn": "none", "queryType": "randomWalk", "rawQuery": true, - "rawSql": "-- Get the queue time of all outstanding bugs\nwith _outstanding_issues as(\n select \n DISTINCT\n b.name as repo_name,\n i.issue_key as issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\n from \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\n where\n b.id in (${repo_id})\n and $__timeFilter(i.created_date)\n and i.status != 'DONE'\n)\n\nselect issue_key, title, queue_time_in_days from _outstanding_issues\norder by 3 desc", + "rawSql": "-- Get the queue time of all outstanding bugs\nwith _outstanding_issues as(\n select \n DISTINCT\n b.name as repo_name,\n i.issue_key,\n i.title,\n i.created_date,\n (TIMESTAMPDIFF(MINUTE, i.created_date,NOW()))/1440 as queue_time_in_days,\n concat(b.url,'/',i.issue_key) as url\n from \n issues i\n left join board_issues bi on i.id = bi.issue_id\n left join boards b on bi.board_id = b.id\n where\n b.id in (${repo_id})\n and $__timeFilter(i.created_date)\n and i.status != 'DONE'\n)\n\nselect concat('#', issue_key) as issue_key, title, url, queue_time_in_days from _outstanding_issues\norder by 4 desc\nlimit 20", "refId": "A", "select": [ [ @@ -892,7 +957,7 @@ ] } ], - "title": "2.5 Queue Time in Days [All Open Issues]", + "title": "2.5 Top 20 Queue Time [All Open Issues]", "type": "barchart" }, { @@ -908,6 +973,7 @@ "cellOptions": { "type": "auto" }, + "filterable": false, "inspect": false }, "mappings": [], @@ -915,7 +981,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -926,36 +993,6 @@ "unit": "none" }, "overrides": [ - { - "matcher": { - "id": "byName", - "options": "=avg_bug_age" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - }, { "matcher": { "id": "byName", @@ -976,7 +1013,7 @@ "properties": [ { "id": "custom.width", - "value": 590 + "value": 718 } ] }, @@ -1015,6 +1052,24 @@ "value": 256 } ] + }, + { + "matcher": { + "id": "byName", + "options": "url" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "${__data.fields.url}" + } + ] + } + ] } ] }, @@ -1114,11 +1169,8 @@ "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "blue", + "value": null } ] } @@ -1205,12 +1257,12 @@ ] } ], - "title": "3.1 Number of New Pull Requests [Selected Time Range]", + "title": "3.1 Number of New Pull Requests", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1242,16 +1294,29 @@ "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "blue", + "value": null } ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Pull Request Count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -1276,7 +1341,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1301,7 +1366,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1342,12 +1407,12 @@ ] } ], - "title": "3.2 Total Number of New Pull Requests [Each Month]", + "title": "3.2 Number of New Pull Requests", "type": "barchart" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1379,7 +1444,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1414,7 +1480,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1439,7 +1505,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})\n and pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", + "rawSql": "-- The PR/MR statuses are standardized to 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})\n and pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", "refId": "A", "select": [ [ @@ -1480,7 +1546,7 @@ ] } ], - "title": "3.3 Top Contributors By Merged PRs", + "title": "3.3 Top 20 Contributors By Merged PRs", "type": "barchart" }, { @@ -1511,7 +1577,7 @@ }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1522,11 +1588,12 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 0.05 } ] }, @@ -1565,12 +1632,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n count(distinct case when status = 'MERGED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})", + "rawSql": "-- The PR/MR statuses are standardized to 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})", "refId": "A", "select": [ [ @@ -1582,6 +1650,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1594,12 +1679,12 @@ ] } ], - "title": "4.1 Ratio of Non-merging Pull Requests of All Closed PRs", + "title": "4.1 Ratio of unmerged PRs of All Closed PRs", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1608,29 +1693,19 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pull Request Count", + "axisLabel": "", "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 4, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, "thresholdsStyle": { "mode": "off" } @@ -1640,15 +1715,62 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] } }, - "overrides": [] - }, - "gridPos": { - "h": 6, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "PR: Open" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed without merging" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PR: Closed and merged" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, "w": 18, "x": 6, "y": 49 @@ -1662,29 +1784,40 @@ } ], "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, "legend": { - "calcs": [ - "sum" - ], + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 + }, "tooltip": { "mode": "multi", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", - "format": "time_series", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as \"PR: Open\",\n count(distinct case when status = 'CLOSED' then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status = 'MERGED' then id else null end) as \"PR: Closed and merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nwith _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as open,\n count(distinct case when status = 'CLOSED' then id else null end) as closed,\n count(distinct case when status = 'MERGED' then id else null end) as merged\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n open as \"PR: Open\",\n closed as \"PR: Closed without merging\",\n merged as \"PR: Closed and merged\"\nFROM _prs\nORDER BY time", "refId": "A", "select": [ [ @@ -1696,6 +1829,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1708,8 +1858,8 @@ ] } ], - "title": "4.2 Pull Request Status Distribution [Each Month]", - "type": "timeseries" + "title": "4.2 Pull Request Status Distribution", + "type": "barchart" }, { "datasource": "mysql", @@ -1723,12 +1873,9 @@ "thresholds": { "mode": "absolute", "steps": [ - { - "color": "green" - }, { "color": "red", - "value": 80 + "value": null } ] } @@ -1815,12 +1962,12 @@ ] } ], - "title": "4.3 Number of Pull Requests Closed without Merging [Selected Time Range]", + "title": "4.3 Number of PRs Closed without Merging", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -1864,7 +2011,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1891,7 +2039,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "tooltip": { "mode": "multi", @@ -1902,12 +2050,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", "refId": "A", "select": [ [ @@ -1919,6 +2068,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1931,7 +2097,7 @@ ] } ], - "title": "4.4 Ratio of Non-merging Pull Requests of All Closed PRs [Each Month]", + "title": "4.4 Ratio of unmerged PRs of All Closed PRs", "type": "timeseries" }, { @@ -1947,14 +2113,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -2020,12 +2188,12 @@ ] } ], - "title": "4.5 Mean Time to Merge of Pull Requests in Days [Selected Time Range]", + "title": "4.5 Mean Time to Merge of Pull Requests", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -2057,7 +2225,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2091,7 +2260,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -2110,12 +2279,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -2127,6 +2297,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -2139,7 +2326,7 @@ ] } ], - "title": "4.6 Mean Time to Merge of Pull Requests in Days [Each Month]", + "title": "4.6 Mean Time to Merge of Pull Requests in Days", "type": "barchart" }, { @@ -2155,14 +2342,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -2226,12 +2415,12 @@ ] } ], - "title": "4.7 Mean Time to Close of Pull Requests in Days [Selected Time Range]", + "title": "4.7 Mean Time to Close of Pull Requests in Days", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -2263,7 +2452,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -2297,7 +2487,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -2316,12 +2506,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n and status in ('CLOSED', 'MERGED')\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_close as \"Time to Close\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n and status in ('CLOSED', 'MERGED')\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n time_to_close as \"Time to Close\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -2333,6 +2524,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -2345,7 +2553,7 @@ ] } ], - "title": "4.8 Mean Time to Close of Pull Requests in Days [Each Month]", + "title": "4.8 Mean Time to Close of Pull Requests in Days", "type": "barchart" }, { @@ -2371,10 +2579,12 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "blue", + "value": null } ] - } + }, + "unit": "short" }, "overrides": [] }, @@ -2457,7 +2667,7 @@ ] } ], - "title": "5.1 Total Number of Successful workflow runs [Selected Time Range]", + "title": "5.1 Total Number of Successful workflow runs", "type": "stat" }, { @@ -2472,7 +2682,12 @@ "mode": "absolute", "steps": [ { - "color": "blue" + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0.9 } ] }, @@ -2564,53 +2779,52 @@ }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "fixed" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" } }, - "decimals": 0, "mappings": [], - "unit": "none" - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "build_count", - "ABORT" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ + "thresholds": { + "mode": "absolute", + "steps": [ { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 } ] - }, + } + }, + "overrides": [ { "matcher": { "id": "byName", - "options": "SUCCESS" + "options": "successful_workflow_run_count" }, "properties": [ { @@ -2625,7 +2839,7 @@ { "matcher": { "id": "byName", - "options": "FAILURE" + "options": "failed_workflow_run_count" }, "properties": [ { @@ -2636,31 +2850,16 @@ } } ] - }, - { - "matcher": { - "id": "byName", - "options": "ABORT" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "rgba(205, 204, 206, 1)", - "mode": "fixed" - } - } - ] } ] }, "gridPos": { "h": 6, - "w": 6, + "w": 12, "x": 12, "y": 74 }, - "id": 105, + "id": 109, "links": [ { "targetBlank": true, @@ -2669,149 +2868,46 @@ } ], "options": { - "displayLabels": [ - "value", - "percent" - ], + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.25, "legend": { "calcs": [], - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "percent", - "value" - ] + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": true + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 }, "tooltip": { - "mode": "single", + "mode": "multi", "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": "mysql", - "editorMode": "code", - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", - "refId": "A", - "select": [ - [ - { - "params": [ - "project_id" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "gitlab_commits", - "timeColumn": "created_at", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "5.3 Total Workflow Runs Result Distribution", - "type": "piechart" - }, - { - "datasource": "mysql", - "description": "Number of successful workflow runs / Number of total workflow runs", - "fieldConfig": { - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "light-orange" - } - ] - }, - "unit": "none" }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 6, - "x": 18, - "y": 74 - }, - "id": 106, - "links": [ - { - "targetBlank": true, - "title": "Build Duration", - "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" - } - ], - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "text": {}, - "textMode": "auto" + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, - "pluginVersion": "9.5.15", + "pluginVersion": "8.0.6", "targets": [ { "datasource": "mysql", "editorMode": "code", "format": "table", "group": [], + "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "with _workflow_runs as (\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_workflow_run_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_workflow_run_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n successful_workflow_run_count,\n failed_workflow_run_count\nFROM _workflow_runs\nORDER BY time\n", "refId": "A", "select": [ [ { "params": [ - "project_id" + "id" ], "type": "column" } @@ -2834,8 +2930,8 @@ ], "limit": 50 }, - "table": "gitlab_commits", - "timeColumn": "created_at", + "table": "ae_projects", + "timeColumn": "ae_create_time", "timeColumnType": "timestamp", "where": [ { @@ -2846,61 +2942,108 @@ ] } ], - "title": "5.4 Mean Workflow Runs Duration in Minutes", - "type": "stat" + "title": "5.3 Number of successful and failed workflow runs", + "type": "barchart" }, { "datasource": "mysql", - "description": "", + "description": "Number of successful workflow runs / Number of total workflow runs", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Workflow Runs Count", - "axisPlacement": "auto", - "axisSoftMin": 0, - "fillOpacity": 80, - "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "off" } }, + "decimals": 0, "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "unit": "none" + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "build_count", + "ABORT" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ { - "color": "green" - }, + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SUCCESS" + }, + "properties": [ { - "color": "red", - "value": 80 + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "FAILURE" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ABORT" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgba(205, 204, 206, 1)", + "mode": "fixed" + } } ] } - }, - "overrides": [] + ] }, "gridPos": { "h": 6, - "w": 12, + "w": 6, "x": 0, "y": 80 }, - "id": 107, + "id": 105, "links": [ { "targetBlank": true, @@ -2909,28 +3052,32 @@ } ], "options": { - "barRadius": 0, - "barWidth": 0.5, - "fullHighlight": false, - "groupWidth": 0.7, + "displayLabels": [ + "value", + "percent" + ], "legend": { "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] }, - "orientation": "auto", - "showValue": "auto", - "stacking": "none", - "text": { - "valueSize": 12 + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": true }, "tooltip": { "mode": "single", "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 + } }, "pluginVersion": "8.0.6", "targets": [ @@ -2939,16 +3086,15 @@ "editorMode": "code", "format": "table", "group": [], - "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Workflow Runs Count\"\nFROM _builds\nORDER BY time\n", + "rawSql": "SELECT\n IF(result = '', 'Unknown', result) as result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", "refId": "A", "select": [ [ { "params": [ - "id" + "project_id" ], "type": "column" } @@ -2971,8 +3117,8 @@ ], "limit": 50 }, - "table": "ae_projects", - "timeColumn": "ae_create_time", + "table": "gitlab_commits", + "timeColumn": "created_at", "timeColumnType": "timestamp", "where": [ { @@ -2983,21 +3129,21 @@ ] } ], - "title": "5.1.1 Total Number of Successful workflow runs [Each Month]", - "type": "barchart" + "title": "5.4 Total Workflow Runs Result Distribution", + "type": "piechart" }, { "datasource": "mysql", - "description": "1. Mean Workflow Runs success rate over time.\n2. The workflow runs being calculated are filtered by \"workflow runs starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)", + "description": "1. Mean Workflow Runs success rate over time.\n2. The workflow runs being calculated are filtered by \"workflow runs starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)", "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Workflow Runs Success Rate(%)", + "axisLabel": "Rate(%)", "axisPlacement": "auto", "axisSoftMin": 0, "fillOpacity": 80, @@ -3012,7 +3158,7 @@ "type": "linear" }, "thresholdsStyle": { - "mode": "off" + "mode": "line" } }, "mappings": [], @@ -3020,11 +3166,12 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 0.9 } ] }, @@ -3040,7 +3187,7 @@ { "id": "color", "value": { - "fixedColor": "blue", + "fixedColor": "green", "mode": "fixed" } } @@ -3050,8 +3197,8 @@ }, "gridPos": { "h": 6, - "w": 12, - "x": 12, + "w": 18, + "x": 6, "y": 80 }, "id": 108, @@ -3074,7 +3221,7 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -3086,7 +3233,7 @@ "mode": "single", "sort": "none" }, - "xTickLabelRotation": 0, + "xTickLabelRotation": 45, "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", @@ -3098,7 +3245,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%github%\"\r\n and cicd_scope_id in (${repo_id})\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Workflow Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%github%\"\r\n and cicd_scope_id in (${repo_id})\r\n -- Enable the following condition to remove the month with incomplete data\r\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%m/%Y') else concat('W', date_format(time,'%u %Y')) end as _time,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Workflow Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", "refId": "A", "select": [ [ @@ -3139,139 +3286,73 @@ ] } ], - "title": "5.2.1 Workflow Runs Success Rate [Each Month]", + "title": "5.5 Workflow Runs Success Rate", "type": "barchart" }, { "datasource": "mysql", - "description": "", + "description": "Number of successful workflow runs / Number of total workflow runs", "fieldConfig": { "defaults": { - "color": { - "mode": "fixed" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Workflow Runs Count", - "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 4, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "successful_workflow_run_count" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } + "color": "light-orange", + "value": null } ] }, - { - "matcher": { - "id": "byName", - "options": "failed_workflow_run_count" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] + "unit": "m" + }, + "overrides": [] }, "gridPos": { "h": 6, - "w": 24, + "w": 6, "x": 0, "y": 86 }, - "id": 109, + "id": 106, "links": [ { "targetBlank": true, - "title": "Build Count", - "url": "https://devlake.apache.org/docs/Metrics/BuildCount" + "title": "Build Duration", + "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" } ], "options": { - "legend": { - "calcs": [ - "sum" - ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false }, - "tooltip": { - "mode": "multi", - "sort": "none" - } + "text": {}, + "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", "editorMode": "code", - "format": "time_series", + "format": "table", "group": [], - "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_workflow_run_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_workflow_run_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1", + "rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ { "params": [ - "id" + "project_id" ], "type": "column" } @@ -3294,8 +3375,8 @@ ], "limit": 50 }, - "table": "ae_projects", - "timeColumn": "ae_create_time", + "table": "gitlab_commits", + "timeColumn": "created_at", "timeColumnType": "timestamp", "where": [ { @@ -3306,12 +3387,12 @@ ] } ], - "title": "5.3.1 Number of Successful and Failed workflow runs [Each Month]", - "type": "timeseries" + "title": "5.6 Mean Workflow Runs Duration", + "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "", "fieldConfig": { "defaults": { "color": { @@ -3320,7 +3401,7 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Workflow Runs Duration(minutes)", + "axisLabel": "", "axisPlacement": "auto", "axisSoftMin": 0, "fillOpacity": 80, @@ -3343,20 +3424,22 @@ "mode": "absolute", "steps": [ { - "color": "purple" + "color": "purple", + "value": null }, { "color": "red", "value": 60 } ] - } + }, + "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", - "options": "mean_duration_minutes" + "options": "mean_duration_sec" }, "properties": [ { @@ -3372,9 +3455,9 @@ }, "gridPos": { "h": 6, - "w": 24, - "x": 0, - "y": 92 + "w": 18, + "x": 6, + "y": 86 }, "id": 110, "links": [ @@ -3386,14 +3469,14 @@ ], "options": { "barRadius": 0, - "barWidth": 0.5, + "barWidth": 0.25, "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -3402,7 +3485,7 @@ "valueSize": 12 }, "tooltip": { - "mode": "single", + "mode": "multi", "sort": "none" }, "xTickLabelRotation": 0, @@ -3418,7 +3501,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n mean_duration_sec/60 as mean_duration_minutes\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n mean_duration_sec\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ @@ -3459,7 +3542,7 @@ ] } ], - "title": "5.4.1 Mean Workflow Runs Duration in Minutes [Each Month]", + "title": "5.7 Mean Workflow Runs Duration", "type": "barchart" }, { @@ -3471,7 +3554,7 @@ "h": 2, "w": 24, "x": 0, - "y": 98 + "y": 92 }, "id": 101, "options": { @@ -3517,7 +3600,7 @@ ] }, "datasource": "mysql", - "definition": "select concat(name, '--', id) as text from repos where id like 'github%'", + "definition": "select concat(name, '--', id) as text from repos where id like 'github%'", "hide": 0, "includeAll": true, "label": "Repo", @@ -3530,6 +3613,34 @@ "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "current": { + "selected": false, + "text": "Month", + "value": "DAYOFMONTH" + }, + "hide": 0, + "includeAll": false, + "label": "Time Interval", + "multi": false, + "name": "interval", + "options": [ + { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + { + "selected": false, + "text": "Week", + "value": "WEEKDAY" + } + ], + "query": "Month : DAYOFMONTH, Week : WEEKDAY", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" } ] }, @@ -3541,6 +3652,6 @@ "timezone": "", "title": "GitHub", "uid": "KXWvOFQnz", - "version": 9, + "version": 25, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/Gitlab.json b/grafana/dashboards/Gitlab.json index b0445270b53..27f6c7a9113 100644 --- a/grafana/dashboards/Gitlab.json +++ b/grafana/dashboards/Gitlab.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 2, + "id": 1, "links": [], "liveNow": false, "panels": [ @@ -103,12 +103,8 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } @@ -195,7 +191,7 @@ ] } ], - "title": "1.1 Number of New Pull Requests [Selected Time Range]", + "title": "1.1 Number of New Pull Requests", "type": "stat" }, { @@ -232,17 +228,29 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "blue", "value": null - }, - { - "color": "red", - "value": 80 } ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Pull Request Count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -267,7 +275,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -292,7 +300,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n -- The following condition will remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -333,7 +341,7 @@ ] } ], - "title": "1.2 Total Number of New Pull Requests [Each Month]", + "title": "1.2 Number of New Pull Requests", "type": "barchart" }, { @@ -406,7 +414,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -472,7 +480,7 @@ ] } ], - "title": "1.3 Top Contributors By Merged PRs", + "title": "1.3 Top 20 Contributors By Merged PRs", "type": "barchart" }, { @@ -494,7 +502,7 @@ "refId": "A" } ], - "title": "2. How PRs are handled?", + "title": "2. How Merge Requests(MRs) are handled?", "type": "row" }, { @@ -515,7 +523,7 @@ }, { "color": "red", - "value": 80 + "value": 0.05 } ] }, @@ -582,7 +590,7 @@ ] } ], - "title": "2.1 Ratio of Non-merging Pull Requests of All Closed or Merged PRs", + "title": "2.1 Ratio of unmerged MRs of All Closed or Merged PRs", "type": "stat" }, { @@ -596,29 +604,19 @@ "custom": { "axisCenteredZero": false, "axisColorMode": "text", - "axisLabel": "Pull Request Count", + "axisLabel": "", "axisPlacement": "auto", - "barAlignment": 1, - "drawStyle": "bars", - "fillOpacity": 50, - "gradientMode": "opacity", + "fillOpacity": 80, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 4, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, "thresholdsStyle": { "mode": "off" } @@ -634,7 +632,53 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "MR: Open" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MR: Closed without merging" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MR: Closed and merged" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { "h": 6, @@ -651,28 +695,40 @@ } ], "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, "legend": { - "calcs": [ - "sum" - ], + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 + }, "tooltip": { "mode": "multi", "sort": "none" - } + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { - "format": "time_series", + "datasource": "mysql", + "editorMode": "code", + "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as \"PR: Open\",\n count(distinct case when status = 'CLOSED' then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status = 'MERGED' then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nwith _prs as (\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as open,\n count(distinct case when status = 'CLOSED' then id else null end) as closed,\n count(distinct case when status = 'MERGED' then id else null end) as merged\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in (${repo_id})\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n open as \"MR: Open\",\n closed as \"MR: Closed without merging\",\n merged as \"MR: Closed and merged\"\nFROM _prs\nORDER BY time", "refId": "A", "select": [ [ @@ -684,6 +740,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -696,8 +769,8 @@ ] } ], - "title": "2.2 Pull Request Status Distribution [Each Month]", - "type": "timeseries" + "title": "2.2 Merge Request Status Distribution", + "type": "barchart" }, { "datasource": "mysql", @@ -711,12 +784,9 @@ "thresholds": { "mode": "absolute", "steps": [ - { - "color": "green" - }, { "color": "red", - "value": 80 + "value": null } ] } @@ -803,7 +873,7 @@ ] } ], - "title": "2.3 Number of Pull Requests Closed without Merging [Selected Time Range]", + "title": "2.3 Number of MRs Closed without Merging", "type": "stat" }, { @@ -821,7 +891,7 @@ "axisPlacement": "auto", "barAlignment": 1, "drawStyle": "line", - "fillOpacity": 50, + "fillOpacity": 0, "gradientMode": "opacity", "hideFrom": { "legend": false, @@ -833,7 +903,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 4, + "pointSize": 10, "scaleDistribution": { "type": "linear" }, @@ -852,7 +922,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -881,7 +952,7 @@ ], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "tooltip": { "mode": "multi", @@ -891,12 +962,14 @@ "pluginVersion": "8.0.6", "targets": [ { + "datasource": "mysql", + "editorMode": "code", "format": "time_series", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", + "rawSql": "-- The PR/MR statuses are standardized to 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\ngroup by 1\n", "refId": "A", "select": [ [ @@ -908,6 +981,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -920,7 +1010,7 @@ ] } ], - "title": "2.4 Ratio of Non-merging PRs of All Closed or Merged PRs [Each Month]", + "title": "2.4 Ratio of unmerged MRs of All Closed or Merged MRs", "type": "timeseries" }, { @@ -936,14 +1026,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1008,7 +1100,7 @@ ] } ], - "title": "2.5 Mean Time to Merge of Pull Requests in Days [Selected Time Range]", + "title": "2.5 Mean Time to Merge of Merge Requests", "type": "stat" }, { @@ -1037,7 +1129,7 @@ "type": "linear" }, "thresholdsStyle": { - "mode": "off" + "mode": "dashed" } }, "mappings": [], @@ -1045,14 +1137,16 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", - "value": 80 + "value": 3 } ] - } + }, + "unit": "d" }, "overrides": [] }, @@ -1079,7 +1173,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "orientation": "auto", "showValue": "auto", @@ -1097,12 +1191,14 @@ "pluginVersion": "8.0.6", "targets": [ { + "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n -- The following condition will remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -$interval(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n time_to_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1143,30 +1239,38 @@ ] } ], - "title": "2.6 Mean Time to Merge of Pull Requests in Days [Each Month]", + "title": "2.6 Mean Time to Merge of MRs", "type": "barchart" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 35 + }, + "id": 110, + "panels": [], + "title": "CI/CD Metrics", + "type": "row" + }, { "datasource": "mysql", - "description": "", + "description": "Number of pipeline runs executed in the selected time range", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "green", + "value": null } ] - } + }, + "unit": "short" }, "overrides": [] }, @@ -1174,14 +1278,14 @@ "h": 6, "w": 6, "x": 0, - "y": 35 + "y": 36 }, - "id": 96, + "id": 102, "links": [ { "targetBlank": true, - "title": "PR Time To Merge", - "url": "https://devlake.apache.org/docs/Metrics/PRTimeToMerge" + "title": "Build Count", + "url": "https://devlake.apache.org/docs/Metrics/BuildCount" } ], "options": { @@ -1190,7 +1294,9 @@ "justifyMode": "auto", "orientation": "auto", "reduceOptions": { - "calcs": [], + "calcs": [ + "mean" + ], "fields": "", "values": false }, @@ -1200,25 +1306,43 @@ "pluginVersion": "9.5.15", "targets": [ { + "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], - "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tavg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\nfrom \n\tpull_requests\nwhere \n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})\n\tand status in ('CLOSED', 'MERGED')\n\n\n", + "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n-- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ { "params": [ - "id" + "project_id" ], "type": "column" } ] ], - "table": "ae_projects", - "timeColumn": "ae_create_time", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "gitlab_commits", + "timeColumn": "created_at", "timeColumnType": "timestamp", "where": [ { @@ -1229,107 +1353,79 @@ ] } ], - "title": "2.7 Mean Time to Close of Pull Requests in Days [Selected Time Range]", + "title": "3.1 Number of successful pipeline runs", "type": "stat" }, { "datasource": "mysql", - "description": "", + "description": "Number of successful pipeline runs / Number of total pipeline runs", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMin": 0, - "fillOpacity": 80, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "off" - } - }, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "red", + "value": null }, { - "color": "red", - "value": 80 + "color": "green", + "value": 0.9 } ] - } + }, + "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 6, - "w": 18, + "w": 6, "x": 6, - "y": 35 + "y": 36 }, - "id": 97, + "id": 103, "links": [ { "targetBlank": true, - "title": "PR Time To Merge", - "url": "https://devlake.apache.org/docs/Metrics/PRTimeToMerge" + "title": "Build Success Rate", + "url": "https://devlake.apache.org/docs/Metrics/BuildSuccessRate" } ], "options": { - "barRadius": 0, - "barWidth": 0.5, - "fullHighlight": false, - "groupWidth": 0.7, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", "orientation": "auto", - "showValue": "auto", - "stacking": "none", - "text": { - "valueSize": 12 - }, - "tooltip": { - "mode": "single", - "sort": "none" + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 + "text": {}, + "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], - "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nwith _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\n and status in ('CLOSED', 'MERGED')\n -- The following condition will remove the month with incomplete data\n -- and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_close as \"Time to Close\"\nFROM _prs\nORDER BY time\n", + "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ { "params": [ - "id" + "project_id" ], "type": "column" } @@ -1352,8 +1448,8 @@ ], "limit": 50 }, - "table": "ae_projects", - "timeColumn": "ae_create_time", + "table": "gitlab_commits", + "timeColumn": "created_at", "timeColumnType": "timestamp", "where": [ { @@ -1364,7 +1460,759 @@ ] } ], - "title": "2.8 Mean Time to Close of Pull Requests in Days [Each Month]", + "title": "3.2 Mean pipeline run success rate %", + "type": "stat" + }, + { + "datasource": "mysql", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "successful_count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "failed_count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 36 + }, + "id": 108, + "links": [ + { + "targetBlank": true, + "title": "Build Count", + "url": "https://devlake.apache.org/docs/Metrics/BuildCount" + } + ], + "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.25, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "normal", + "text": { + "valueSize": 12 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "datasource": "mysql", + "editorMode": "code", + "format": "table", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with _builds as (\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n successful_count,\n failed_count\nFROM _builds\nORDER BY time\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "ae_projects", + "timeColumn": "ae_create_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "3.3 Number of successful and failed pipeline runs", + "type": "barchart" + }, + { + "datasource": "mysql", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "decimals": 0, + "mappings": [], + "unit": "none" + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "build_count", + "ABORT" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SUCCESS" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "FAILURE" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ABORT" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgba(205, 204, 206, 1)", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 42 + }, + "id": 104, + "links": [ + { + "targetBlank": true, + "title": "Build Count", + "url": "https://devlake.apache.org/docs/Metrics/BuildCount" + } + ], + "options": { + "displayLabels": [ + "value", + "percent" + ], + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "datasource": "mysql", + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n IF(result = '', 'Unknown', result) as result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", + "refId": "A", + "select": [ + [ + { + "params": [ + "project_id" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "gitlab_commits", + "timeColumn": "created_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "3.4 Pipeline runs result distribution", + "type": "piechart" + }, + { + "datasource": "mysql", + "description": "1. Mean Pipeline Runs success rate over time.\n2. The Pipeline runs being calculated are filtered by \"workflow runs starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Rate(%)", + "axisPlacement": "auto", + "axisSoftMin": 0, + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "line" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 0.9 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 18, + "x": 6, + "y": 42 + }, + "id": 107, + "interval": "", + "links": [ + { + "targetBlank": true, + "title": "Build Success Rate", + "url": "https://devlake.apache.org/docs/Metrics/BuildSuccessRate" + } + ], + "options": { + "barRadius": 0, + "barWidth": 0.5, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "text": { + "valueSize": 12 + }, + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 45, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "datasource": "mysql", + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%gitlab%\"\r\n and cicd_scope_id in (${repo_id})\r\n -- Enable the following condition to remove the month with incomplete data\r\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%m/%Y') else concat('W', date_format(time,'%u %Y')) end as _time,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Pipeline Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "refId": "A", + "select": [ + [ + { + "params": [ + "progress" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "ca_analysis", + "timeColumn": "create_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "3.5 Pipeline run success rate %", + "type": "barchart" + }, + { + "datasource": "mysql", + "description": "Number of successful pipeline runs / Number of total pipeline runs", + "fieldConfig": { + "defaults": { + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-orange", + "value": null + } + ] + }, + "unit": "m" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 48 + }, + "id": 105, + "links": [ + { + "targetBlank": true, + "title": "Build Duration", + "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" + } + ], + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "9.5.15", + "targets": [ + { + "datasource": "mysql", + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "refId": "A", + "select": [ + [ + { + "params": [ + "project_id" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "gitlab_commits", + "timeColumn": "created_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "3.6 Mean pipeline runs duration", + "type": "stat" + }, + { + "datasource": "mysql", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + }, + { + "color": "red", + "value": 60 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "mean_duration_sec" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-orange", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 18, + "x": 6, + "y": 48 + }, + "id": 109, + "links": [ + { + "targetBlank": true, + "title": "Build Duration", + "url": "https://devlake.apache.org/docs/Metrics/BuildDuration" + } + ], + "options": { + "barRadius": 0, + "barWidth": 0.25, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "text": { + "valueSize": 12 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "datasource": "mysql", + "editorMode": "code", + "format": "table", + "group": [], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -$interval(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%gitlab%\"\n and cicd_scope_id in (${repo_id})\n -- Enable the following condition to remove the month with incomplete data\n -- and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n case when '$interval' = 'DAYOFMONTH' then date_format(time,'%M %Y') else concat('W', date_format(time,'%u %Y')) end as _time,\n mean_duration_sec\nFROM _builds\nORDER BY time\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "ae_projects", + "timeColumn": "ae_create_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "3.7 Mean pipeline run duration", "type": "barchart" }, { @@ -1376,7 +2224,7 @@ "h": 2, "w": 24, "x": 0, - "y": 41 + "y": 54 }, "id": 99, "options": { @@ -1435,6 +2283,33 @@ "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "current": { + "selected": false, + "text": "Month", + "value": "DAYOFMONTH" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "interval", + "options": [ + { + "selected": true, + "text": "Month", + "value": "DAYOFMONTH" + }, + { + "selected": false, + "text": "Week", + "value": "WEEKDAY" + } + ], + "query": "Month : DAYOFMONTH, Week : WEEKDAY", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" } ] }, @@ -1446,6 +2321,6 @@ "timezone": "", "title": "GitLab", "uid": "msSjEq97z", - "version": 2, + "version": 27, "weekStart": "" } \ No newline at end of file