Skip to content

Commit

Permalink
fix: update change lead time details dashboard (#8179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Startrekzky authored Nov 1, 2024
1 parent c7db64e commit 5cd96a1
Showing 1 changed file with 44 additions and 29 deletions.
73 changes: 44 additions & 29 deletions grafana/dashboards/DORADetails-LeadTimeforChanges.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 36,
"links": [
{
"asDropdown": false,
@@ -47,17 +46,16 @@
"y": 0
},
"id": 63,
"links": [],
"options": {
"code": {
"language": "plaintext",
"showLineNumbers": false,
"showMiniMap": false
},
"content": "This dashboard shows the details about [Lead Time for Changes](https://devlake.apache.org/docs/Metrics/LeadTimeForChanges) in DORA.",
"content": "- This dashboard shows the details about [Lead Time for Changes](https://devlake.apache.org/docs/Metrics/LeadTimeForChanges) in DORA.\n- It displays the statistics for pull requests **deployed** within the selected time range.",
"mode": "markdown"
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": {
@@ -112,16 +110,19 @@
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -131,7 +132,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no cycle_time to make sure cycle_time equals the sum of the four metrics below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(cycle_time) as 'PR Cycle Time(h)'\nFROM _prs",
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no cycle_time to make sure cycle_time equals the sum of the four metrics below\n\t\tcoalesce(prm.pr_cycle_time/60,0) as cycle_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(prm.pr_deployed_date)\n -- and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(cycle_time) as 'PR Cycle Time(h)'\nFROM _prs",
"refId": "A",
"select": [
[
@@ -217,16 +218,19 @@
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -236,7 +240,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no coding_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as coding_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(coding_time) as 'Coding Time(h)'\nFROM _prs\n",
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no coding_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_coding_time/60,0) as coding_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(prm.pr_deployed_date)\n -- and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(coding_time) as 'Coding Time(h)'\nFROM _prs\n",
"refId": "A",
"select": [
[
@@ -353,16 +357,19 @@
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -372,7 +379,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no pickup_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as pickup_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(pickup_time) as 'Pickup Time(h)'\nFROM _prs\n",
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no pickup_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_pickup_time/60,0) as pickup_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(prm.pr_deployed_date)\n -- and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(pickup_time) as 'Pickup Time(h)'\nFROM _prs\n",
"refId": "A",
"select": [
[
@@ -489,16 +496,19 @@
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -508,7 +518,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no review_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as review_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(review_time) as 'Review Time(h)'\nFROM _prs",
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no review_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_review_time/60,0) as review_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(prm.pr_deployed_date)\n -- and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(review_time) as 'Review Time(h)'\nFROM _prs",
"refId": "A",
"select": [
[
@@ -625,16 +635,19 @@
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -644,7 +657,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no deploy_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as deploy_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(pr.created_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(deploy_time) as 'PR Deploy Time(h)'\nFROM _prs",
"rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.created_date as pr_issued_date,\n -- convert null to 0 if a PR has no deploy_time to make sure cycle_time equals the sum of the four sub-metrics\n\t\tcoalesce(prm.pr_deploy_time/60,0) as deploy_time\n FROM pull_requests pr\n left join project_pr_metrics prm on pr.id = prm.id\n join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table = 'repos' \n WHERE\n $__timeFilter(prm.pr_deployed_date)\n -- and pr.created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and pm.project_name in (${project})\n GROUP BY 1,2,3\n)\n\nSELECT \n avg(deploy_time) as 'PR Deploy Time(h)'\nFROM _prs",
"refId": "A",
"select": [
[
@@ -796,7 +809,6 @@
"y": 9
},
"id": 70,
"links": [],
"options": {
"cellHeight": "sm",
"footer": {
@@ -811,7 +823,7 @@
"showHeader": true,
"sortBy": []
},
"pluginVersion": "9.5.15",
"pluginVersion": "11.2.0",
"targets": [
{
"datasource": "mysql",
@@ -867,8 +879,7 @@
}
],
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"schemaVersion": 39,
"tags": [
"DORA"
],
@@ -877,11 +888,15 @@
{
"current": {
"selected": false,
"text": "All",
"value": "$__all"
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "mysql",
"definition": "select distinct name from projects",
"definition": "select distinct name from projects",
"hide": 0,
"includeAll": true,
"label": "Project",
@@ -902,7 +917,7 @@
"value": "2023"
},
"datasource": "mysql",
"definition": "select dora_report from dora_benchmarks",
"definition": "select dora_report from dora_benchmarks",
"hide": 0,
"includeAll": false,
"label": "DORA Report",
@@ -923,7 +938,7 @@
"value": "Failed Deployment Recovery Time"
},
"datasource": "mysql",
"definition": "SELECT \n CASE \n WHEN dora_report = '2023' THEN \"Failed Deployment Recovery Time\"\n WHEN dora_report = '2021' THEN \"Median Time to Restore Service\"\n ELSE NULL \n END AS title_value\nFROM dora_benchmarks\nWHERE dora_report = '${dora_report:raw}'",
"definition": "SELECT \n CASE \n WHEN dora_report = '2023' THEN \"Failed Deployment Recovery Time\"\n WHEN dora_report = '2021' THEN \"Median Time to Restore Service\"\n ELSE NULL \n END AS title_value\nFROM dora_benchmarks\nWHERE dora_report = '${dora_report:raw}'",
"hide": 2,
"includeAll": false,
"label": "TitleValue",
@@ -947,6 +962,6 @@
"timezone": "utc",
"title": "DORA Details - Lead Time for Changes",
"uid": "Lead-time-for-changes",
"version": 6,
"version": 7,
"weekStart": ""
}

0 comments on commit 5cd96a1

Please sign in to comment.