This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch add-recovery-time-metric3
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/add-recovery-time-metric3 by 
this push:
     new 131857186 fix: benchmarks rename to dora_report
131857186 is described below

commit 131857186979a3b00c61f26d34db162b7f47c8d1
Author: abeizn <[email protected]>
AuthorDate: Fri Feb 23 11:23:34 2024 +0800

    fix: benchmarks rename to dora_report
---
 ...mark.go => 20240223_add_dora_2023_benchmark.go} |  20 +--
 grafana/dashboards/DORA.json                       |  62 ++++-----
 grafana/dashboards/DORAByTeam.json                 |  56 ++++----
 grafana/dashboards/DORADebug.json                  | 143 +++++++++++++++++----
 4 files changed, 187 insertions(+), 94 deletions(-)

diff --git 
a/backend/plugins/dora/models/migrationscripts/20240222_add_dora_2023_benchmark.go
 
b/backend/plugins/dora/models/migrationscripts/20240223_add_dora_2023_benchmark.go
similarity index 94%
rename from 
backend/plugins/dora/models/migrationscripts/20240222_add_dora_2023_benchmark.go
rename to 
backend/plugins/dora/models/migrationscripts/20240223_add_dora_2023_benchmark.go
index c5ec0c841..b1d8eceda 100644
--- 
a/backend/plugins/dora/models/migrationscripts/20240222_add_dora_2023_benchmark.go
+++ 
b/backend/plugins/dora/models/migrationscripts/20240223_add_dora_2023_benchmark.go
@@ -33,7 +33,7 @@ type doraBenchmarkBasic struct {
        Medium     string `gorm:"type:varchar(255)"`
        High       string `gorm:"type:varchar(255)"`
        Elite      string `gorm:"type:varchar(255)"`
-       Benchmarks string `gorm:"type:varchar(20)"`
+       DoraReport string `gorm:"type:varchar(20)"`
 }
 
 func (doraBenchmarkBasic) TableName() string {
@@ -64,7 +64,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between once per month and once every 6 
months(medium)",
                High:       "Between once per day and once per month(high)",
                Elite:      "On-demand(elite)",
-               Benchmarks: "2021 report",
+               DoraReport: "2021",
        }
        err = db.Create(doraBenchmark2021DF)
        if err != nil {
@@ -80,7 +80,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between one week and six months(medium)",
                High:       "Less than one week(high)",
                Elite:      "Less than one hour(elite)",
-               Benchmarks: "2021 report",
+               DoraReport: "2021",
        }
        err = db.Create(doraBenchmark2021LTC)
        if err != nil {
@@ -96,7 +96,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "21%-30%(medium)",
                High:       "16%-20%(high)",
                Elite:      "0-15%(elite)",
-               Benchmarks: "2021 report",
+               DoraReport: "2021",
        }
        err = db.Create(doraBenchmark2021CFR)
        if err != nil {
@@ -112,7 +112,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between one day and one week(medium)",
                High:       "Less than one day(high)",
                Elite:      "Less than one hour(elite)",
-               Benchmarks: "2021 report",
+               DoraReport: "2021",
        }
        err = db.Create(doraBenchmark2021TTS)
        if err != nil {
@@ -129,7 +129,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between once per week and once per month(medium)",
                High:       "Between once per day and once per week(high)",
                Elite:      "On-demand(elite)",
-               Benchmarks: "2023 report",
+               DoraReport: "2023",
        }
        err = db.Create(doraBenchmark2023DF)
        if err != nil {
@@ -145,7 +145,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between one week and one month(medium)",
                High:       "Between one day and one week(high)",
                Elite:      "Less than one day(elite)",
-               Benchmarks: "2023 report",
+               DoraReport: "2023",
        }
        err = db.Create(doraBenchmark2023LTC)
        if err != nil {
@@ -161,7 +161,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "10%-15%(medium)",
                High:       "5%-10%(high)",
                Elite:      "0-5%(elite)",
-               Benchmarks: "2023 report",
+               DoraReport: "2023",
        }
        err = db.Create(doraBenchmark2023CFR)
        if err != nil {
@@ -177,7 +177,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
                Medium:     "Between one day and one week(medium)",
                High:       "Less than one day(high)",
                Elite:      "Less than one hour(elite)",
-               Benchmarks: "2023 report",
+               DoraReport: "2023",
        }
        err = db.Create(doraBenchmark2023FDRT)
        if err != nil {
@@ -188,7 +188,7 @@ func (u *adddoraBenchmark2023) Up(baseRes context.BasicRes) 
errors.Error {
 }
 
 func (*adddoraBenchmark2023) Version() uint64 {
-       return 20240222000002
+       return 20240223000003
 }
 
 func (*adddoraBenchmark2023) Name() string {
diff --git a/grafana/dashboards/DORA.json b/grafana/dashboards/DORA.json
index 5b17f6f54..bbdbefa5b 100644
--- a/grafana/dashboards/DORA.json
+++ b/grafana/dashboards/DORA.json
@@ -18,7 +18,7 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
-  "id": 36,
+  "id": 37,
   "links": [],
   "liveNow": false,
   "panels": [
@@ -28,7 +28,7 @@
         "uid": "grafana"
       },
       "gridPos": {
-        "h": 6,
+        "h": 7,
         "w": 24,
         "x": 0,
         "y": 0
@@ -41,7 +41,7 @@
           "showLineNumbers": false,
           "showMiniMap": false
         },
-        "content": "- See [how to 
config](https://devlake.apache.org/docs/DORA) this dashboard\n- Data Sources 
Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, webhook, 
etc. \n  - `Pull Requests` from GitHub PRs, GitLab MRs, BitBucket PRs, Azure 
DevOps PRs, etc.\n  - `Incidents` from Jira issues, GitHub issues, TAPD issues, 
PagerDuty Incidents, etc. \n- Transformation Required: Define `deployments` and 
`incidents` in [data transformations](https://devlake.apache.org/ [...]
+        "content": "- See [how to 
config](https://devlake.apache.org/docs/DORA) this dashboard\n- Data Sources 
Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, webhook, 
etc. \n  - `Pull Requests` from GitHub PRs, GitLab MRs, BitBucket PRs, Azure 
DevOps PRs, etc.\n  - `Incidents` from Jira issues, GitHub issues, TAPD issues, 
PagerDuty Incidents, etc. \n- Transformation Required: Define `deployments` and 
`incidents` in [data transformations](https://devlake.apache.org/ [...]
         "mode": "markdown"
       },
       "pluginVersion": "9.5.15",
@@ -178,7 +178,7 @@
         "h": 6,
         "w": 24,
         "x": 0,
-        "y": 6
+        "y": 7
       },
       "id": 8,
       "links": [],
@@ -205,7 +205,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
+          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
           "refId": "A",
           "select": [
             [
@@ -314,7 +314,7 @@
         "h": 5,
         "w": 6,
         "x": 0,
-        "y": 12
+        "y": 13
       },
       "id": 11,
       "links": [],
@@ -343,7 +343,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
+          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
           "refId": "A",
           "select": [
             [
@@ -452,7 +452,7 @@
         "h": 5,
         "w": 6,
         "x": 6,
-        "y": 12
+        "y": 13
       },
       "id": 12,
       "links": [],
@@ -481,7 +481,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr \n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deployment_commit_id = cdc.id\n\tWHERE\n\t  
pm.proje [...]
+          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr \n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deployment_commit_id = cdc.id\n\tWHERE\n\t  
pm.proje [...]
           "refId": "A",
           "select": [
             [
@@ -590,7 +590,7 @@
         "h": 5,
         "w": 6,
         "x": 12,
-        "y": 12
+        "y": 13
       },
       "id": 14,
       "links": [],
@@ -619,7 +619,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 3: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\tJOIN proje [...]
+          "rawSql": "-- Metric 3: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\tJOIN proje [...]
           "refId": "A",
           "select": [
             [
@@ -733,7 +733,7 @@
         "h": 5,
         "w": 6,
         "x": 18,
-        "y": 12
+        "y": 13
       },
       "id": 17,
       "links": [],
@@ -762,7 +762,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
+          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
           "refId": "A",
           "select": [
             [
@@ -855,7 +855,7 @@
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 17
+        "y": 18
       },
       "id": 2,
       "links": [],
@@ -980,7 +980,7 @@
         "h": 8,
         "w": 12,
         "x": 12,
-        "y": 17
+        "y": 18
       },
       "id": 6,
       "links": [],
@@ -1125,7 +1125,7 @@
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 25
+        "y": 26
       },
       "id": 5,
       "links": [],
@@ -1274,7 +1274,7 @@
         "h": 8,
         "w": 12,
         "x": 12,
-        "y": 25
+        "y": 26
       },
       "id": 9,
       "links": [],
@@ -1310,7 +1310,7 @@
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
+          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
           "refId": "A",
           "select": [
             [
@@ -1366,7 +1366,7 @@
     "list": [
       {
         "current": {
-          "selected": true,
+          "selected": false,
           "text": [
             "All"
           ],
@@ -1391,19 +1391,19 @@
       },
       {
         "current": {
-          "selected": false,
-          "text": "2023 report",
-          "value": "2023 report"
+          "selected": true,
+          "text": "2023",
+          "value": "2023"
         },
         "datasource": "mysql",
-        "definition": "select benchmarks from dora_benchmarks",
+        "definition": "select dora_report from dora_benchmarks",
         "hide": 0,
         "includeAll": false,
-        "label": "Benchmarks",
+        "label": "DORA Report",
         "multi": false,
-        "name": "benchmarks",
+        "name": "dora_report",
         "options": [],
-        "query": "select benchmarks from dora_benchmarks",
+        "query": "select dora_report from dora_benchmarks",
         "refresh": 1,
         "regex": "",
         "skipUrlSync": false,
@@ -1417,14 +1417,14 @@
           "value": "Failed Deployment Recovery Time"
         },
         "datasource": "mysql",
-        "definition": "SELECT \n  CASE \n    WHEN benchmarks = '2023 report' 
THEN \"Failed Deployment Recovery Time\"\n    WHEN benchmarks = '2021 report' 
THEN \"Median Time to Restore Service\"\n    ELSE NULL \n  END AS 
title_value\nFROM dora_benchmarks\nWHERE benchmarks = '${benchmarks: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",
         "multi": false,
         "name": "title_value",
         "options": [],
-        "query": "SELECT \n  CASE \n    WHEN benchmarks = '2023 report' THEN 
\"Failed Deployment Recovery Time\"\n    WHEN benchmarks = '2021 report' THEN 
\"Median Time to Restore Service\"\n    ELSE NULL \n  END AS title_value\nFROM 
dora_benchmarks\nWHERE benchmarks = '${benchmarks:raw}'",
+        "query": "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}'",
         "refresh": 1,
         "regex": "",
         "skipUrlSync": false,
@@ -1439,8 +1439,8 @@
   },
   "timepicker": {},
   "timezone": "",
-  "title": "DORA",
-  "uid": "qNo8_0M4z",
-  "version": 8,
+  "title": "DORA3",
+  "uid": "qNo8_0M4z3",
+  "version": 3,
   "weekStart": ""
 }
\ No newline at end of file
diff --git a/grafana/dashboards/DORAByTeam.json 
b/grafana/dashboards/DORAByTeam.json
index d8a38beac..7d9b8b354 100644
--- a/grafana/dashboards/DORAByTeam.json
+++ b/grafana/dashboards/DORAByTeam.json
@@ -34,7 +34,7 @@
         "uid": "grafana"
       },
       "gridPos": {
-        "h": 7,
+        "h": 10,
         "w": 24,
         "x": 0,
         "y": 0
@@ -47,7 +47,7 @@
           "showLineNumbers": false,
           "showMiniMap": false
         },
-        "content": "- See [how to 
config](https://devlake.apache.org/docs/DORA) this dashboard\n- Data Sources 
Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, webhook, 
etc. \n  - `Pull Requests` from GitHub PRs, GitLab MRs, BitBucket PRs, Azure 
DevOps PRs, etc.\n  - `Incidents` from Jira issues, GitHub issues, TAPD issues, 
PagerDuty Incidents, etc. \n- Transformation Required: Define `deployments` and 
`incidents` in [data transformations](https://devlake.apache.org/ [...]
+        "content": "- See [how to 
config](https://devlake.apache.org/docs/DORA) this dashboard\n- Data Sources 
Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, webhook, 
etc. \n  - `Pull Requests` from GitHub PRs, GitLab MRs, BitBucket PRs, Azure 
DevOps PRs, etc.\n  - `Incidents` from Jira issues, GitHub issues, TAPD issues, 
PagerDuty Incidents, etc. \n- Transformation Required: Define `deployments` and 
`incidents` in [data transformations](https://devlake.apache.org/ [...]
         "mode": "markdown"
       },
       "pluginVersion": "9.5.15",
@@ -183,7 +183,7 @@
         "h": 6,
         "w": 24,
         "x": 0,
-        "y": 7
+        "y": 10
       },
       "id": 8,
       "links": [],
@@ -208,7 +208,7 @@
           "format": "table",
           "hide": false,
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
+          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
           "refId": "A",
           "sql": {
             "columns": [
@@ -297,7 +297,7 @@
         "h": 5,
         "w": 6,
         "x": 0,
-        "y": 13
+        "y": 16
       },
       "id": 11,
       "links": [],
@@ -326,7 +326,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
+          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
           "refId": "A",
           "select": [
             [
@@ -435,7 +435,7 @@
         "h": 5,
         "w": 6,
         "x": 6,
-        "y": 13
+        "y": 16
       },
       "id": 12,
       "links": [],
@@ -462,7 +462,7 @@
           "format": "table",
           "hide": false,
           "rawQuery": true,
-          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr\n\t\tjoin 
user_accounts ua on pr.author_id = ua.account_id\n    \tjoin users u on 
ua.user_id = u.id\n    \tjoin team_users tu on u.id = tu.user_id\n    \tjoin 
teams t on tu.team_id = t.id\n\t\tjoin project_pr_metrics ppm on ppm.id = p 
[...]
+          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr\n\t\tjoin 
user_accounts ua on pr.author_id = ua.account_id\n    \tjoin users u on 
ua.user_id = u.id\n    \tjoin team_users tu on u.id = tu.user_id\n    \tjoin 
teams t on tu.team_id = t.id\n\t\tjoin project_pr_metrics ppm on ppm.id = p 
[...]
           "refId": "A",
           "sql": {
             "columns": [
@@ -551,7 +551,7 @@
         "h": 5,
         "w": 6,
         "x": 12,
-        "y": 13
+        "y": 16
       },
       "id": 14,
       "links": [],
@@ -578,7 +578,7 @@
           "format": "table",
           "hide": false,
           "rawQuery": true,
-          "rawSql": "-- Metric 4: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t    JOIN com [...]
+          "rawSql": "-- Metric 4: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t    JOIN com [...]
           "refId": "A",
           "sql": {
             "columns": [
@@ -672,7 +672,7 @@
         "h": 5,
         "w": 6,
         "x": 18,
-        "y": 13
+        "y": 16
       },
       "id": 13,
       "links": [],
@@ -699,7 +699,7 @@
           "format": "table",
           "hide": false,
           "rawQuery": true,
-          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits 
cdc\n\t\tJOIN commits c on cdc.commit_sha = c.sha\n        join user_accounts 
ua on c.author_id = ua.account_id\n        join users u on ua.user_id = u.id\n  
      join team_users tu on u.id = tu.user_id [...]
+          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits 
cdc\n\t\tJOIN commits c on cdc.commit_sha = c.sha\n        join user_accounts 
ua on c.author_id = ua.account_id\n        join users u on ua.user_id = u.id\n  
      join team_users tu on u.id = tu.user_id [...]
           "refId": "A",
           "sql": {
             "columns": [
@@ -772,7 +772,7 @@
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 18
+        "y": 21
       },
       "id": 2,
       "links": [],
@@ -875,7 +875,7 @@
         "h": 8,
         "w": 12,
         "x": 12,
-        "y": 18
+        "y": 21
       },
       "id": 6,
       "links": [],
@@ -998,7 +998,7 @@
         "h": 8,
         "w": 12,
         "x": 0,
-        "y": 26
+        "y": 29
       },
       "id": 5,
       "links": [],
@@ -1123,7 +1123,7 @@
         "h": 8,
         "w": 12,
         "x": 12,
-        "y": 26
+        "y": 29
       },
       "id": 9,
       "links": [],
@@ -1213,19 +1213,19 @@
       },
       {
         "current": {
-          "selected": true,
-          "text": "2021 report",
-          "value": "2021 report"
+          "selected": false,
+          "text": "2023",
+          "value": "2023"
         },
         "datasource": "mysql",
-        "definition": "select benchmarks from dora_benchmarks",
+        "definition": "select dora_report from dora_benchmarks",
         "hide": 0,
         "includeAll": false,
-        "label": "Benchmarks",
+        "label": "DORA Report",
         "multi": false,
-        "name": "benchmarks",
+        "name": "dora_report",
         "options": [],
-        "query": "select benchmarks from dora_benchmarks",
+        "query": "select dora_report from dora_benchmarks",
         "refresh": 1,
         "regex": "",
         "skipUrlSync": false,
@@ -1235,18 +1235,18 @@
       {
         "current": {
           "selected": false,
-          "text": "Median Time to Restore Service",
-          "value": "Median Time to Restore Service"
+          "text": "Failed Deployment Recovery Time",
+          "value": "Failed Deployment Recovery Time"
         },
         "datasource": "mysql",
-        "definition": "SELECT \n  CASE \n    WHEN benchmarks = '2023 report' 
THEN \"Failed Deployment Recovery Time\"\n    WHEN benchmarks = '2021 report' 
THEN \"Median Time to Restore Service\"\n    ELSE NULL \n  END AS 
title_value\nFROM dora_benchmarks\nWHERE benchmarks = '${benchmarks: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",
         "multi": false,
         "name": "title_value",
         "options": [],
-        "query": "SELECT \n  CASE \n    WHEN benchmarks = '2023 report' THEN 
\"Failed Deployment Recovery Time\"\n    WHEN benchmarks = '2021 report' THEN 
\"Median Time to Restore Service\"\n    ELSE NULL \n  END AS title_value\nFROM 
dora_benchmarks\nWHERE benchmarks = '${benchmarks:raw}'",
+        "query": "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}'",
         "refresh": 1,
         "regex": "",
         "skipUrlSync": false,
@@ -1263,6 +1263,6 @@
   "timezone": "",
   "title": "DORA (by Team)",
   "uid": "66YkL8y4z",
-  "version": 2,
+  "version": 4,
   "weekStart": ""
 }
\ No newline at end of file
diff --git a/grafana/dashboards/DORADebug.json 
b/grafana/dashboards/DORADebug.json
index ca7d9873f..c39423661 100644
--- a/grafana/dashboards/DORADebug.json
+++ b/grafana/dashboards/DORADebug.json
@@ -18,7 +18,7 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
-  "id": 36,
+  "id": 26,
   "links": [],
   "liveNow": false,
   "panels": [
@@ -321,7 +321,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
+          "rawSql": "-- Metric 1: Deployment Frequency\nwith 
last_few_calendar_months as(\n-- construct the last few calendar months within 
the selected time period in the top-right corner\n\tSELECT 
CAST((SYSDATE()-INTERVAL (H+T+U) DAY) AS date) day\n\tFROM ( SELECT 0 
H\n\t\t\tUNION ALL SELECT 100 UNION ALL SELECT 200 UNION ALL SELECT 300\n\t\t) 
H CROSS JOIN ( SELECT 0 T\n\t\t\tUNION ALL SELECT  10 UNION ALL SELECT  20 
UNION ALL SELECT  30\n\t\t\tUNION ALL SELECT  40 UNION ALL SELECT  50 [...]
           "refId": "A",
           "select": [
             [
@@ -552,12 +552,13 @@
       "targets": [
         {
           "datasource": "mysql",
+          "editorMode": "code",
           "format": "table",
           "group": [],
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 1: Number of deployments per month\nwith 
_deployments as(\n-- When deploying multiple commits in one pipeline, GitLab 
and BitBucket may generate more than one deployment. However, DevLake consider 
these deployments as ONE production deployment and use the last one's 
finished_date as the finished date.\n\tSELECT 
\n\t\tdate_format(deployment_finished_date,'%y/%m') as 
month,\n\t\tcount(cicd_deployment_id) as deployment_count\n\tFROM 
(\n\t\tSELECT\n\t\t\tcdc.ci [...]
+          "rawSql": "-- Metric 1: Number of deployments per month\nwith 
_deployments as(\n-- When deploying multiple commits in one pipeline, GitLab 
and BitBucket may generate more than one deployment. However, DevLake consider 
these deployments as ONE production deployment and use the last one's 
finished_date as the finished date.\n\tSELECT 
\n\t\tdate_format(deployment_finished_date,'%y/%m') as 
month,\n\t\tcount(cicd_deployment_id) as deployment_count\n\tFROM 
(\n\t\tSELECT\n\t\t\tcdc.ci [...]
           "refId": "A",
           "select": [
             [
@@ -569,6 +570,23 @@
               }
             ]
           ],
+          "sql": {
+            "columns": [
+              {
+                "parameters": [],
+                "type": "function"
+              }
+            ],
+            "groupBy": [
+              {
+                "property": {
+                  "type": "string"
+                },
+                "type": "groupBy"
+              }
+            ],
+            "limit": 50
+          },
           "table": "_devlake_blueprints",
           "timeColumn": "created_at",
           "timeColumnType": "timestamp",
@@ -1177,7 +1195,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr \n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deployment_commit_id = cdc.id\n\tWHERE\n\t  
pm.proje [...]
+          "rawSql": "-- Metric 2: median lead time for changes\nwith _pr_stats 
as (\n-- get the cycle time of PRs deployed by the deployments finished in the 
selected period\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr \n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deployment_commit_id = cdc.id\n\tWHERE\n\t  
pm.proje [...]
           "refId": "A",
           "select": [
             [
@@ -1451,12 +1469,13 @@
       "targets": [
         {
           "datasource": "mysql",
+          "editorMode": "code",
           "format": "table",
           "group": [],
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "-- Metric 2: median change lead time per month\nwith 
_pr_stats as (\n-- get the cycle time of PRs deployed by the deployments 
finished each month\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tdate_format(cdc.finished_date,'%y/%m') as 
month,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr\n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deploy [...]
+          "rawSql": "-- Metric 2: median change lead time per month\nwith 
_pr_stats as (\n-- get the cycle time of PRs deployed by the deployments 
finished each month\n\tSELECT\n\t\tdistinct 
pr.id,\n\t\tdate_format(cdc.finished_date,'%y/%m') as 
month,\n\t\tppm.pr_cycle_time\n\tFROM\n\t\tpull_requests pr\n\t\tjoin 
project_pr_metrics ppm on ppm.id = pr.id\n\t\tjoin project_mapping pm on 
pr.base_repo_id = pm.row_id and pm.`table` = 'repos'\n\t\tjoin 
cicd_deployment_commits cdc on ppm.deploy [...]
           "refId": "A",
           "select": [
             [
@@ -1468,6 +1487,23 @@
               }
             ]
           ],
+          "sql": {
+            "columns": [
+              {
+                "parameters": [],
+                "type": "function"
+              }
+            ],
+            "groupBy": [
+              {
+                "property": {
+                  "type": "string"
+                },
+                "type": "groupBy"
+              }
+            ],
+            "limit": 50
+          },
           "table": "ae_projects",
           "timeColumn": "ae_create_time",
           "timeColumnType": "timestamp",
@@ -2643,7 +2679,7 @@
           "refId": "A"
         }
       ],
-      "title": "Check \"Change Failure Rate\" & \"Median Time to Restore 
Service\"",
+      "title": "Check \"Change Failure Rate\" & \"${title_value}\"",
       "type": "row"
     },
     {
@@ -2664,7 +2700,7 @@
           "showLineNumbers": false,
           "showMiniMap": false
         },
-        "content": "- See the definition and calculation logic of [Median Time 
to Restore Service](https://devlake.apache.org/docs/Metrics/MTTR)\n- Data 
Sources Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, 
BitBucket Pipelines, or Webhook, etc. \n  - `Incidents` from Jira issues, 
GitHub issues, TAPD issues, PagerDuty Incidents, etc. \n- Transformation 
Required: Define `deployments` and `incidents` in [data 
transformations](https://devlake.apache.org/docs/Configura [...]
+        "content": "- See the definition and calculation logic of 
[${title_value}](https://devlake.apache.org/docs/Metrics/MTTR)\n- Data Sources 
Required: \n  - `Deployments` from Jenkins, GitLab CI, GitHub Action, BitBucket 
Pipelines, or Webhook, etc. \n  - `Incidents` from Jira issues, GitHub issues, 
TAPD issues, PagerDuty Incidents, etc. \n- Transformation Required: Define 
`deployments` and `incidents` in [data 
transformations](https://devlake.apache.org/docs/Configuration/Tutorial#st [...]
         "mode": "markdown"
       },
       "pluginVersion": "9.5.15",
@@ -2896,7 +2932,7 @@
           "calcs": [
             "lastNotNull"
           ],
-          "fields": "/^median_time_to_resolve$/",
+          "fields": "/.*/",
           "values": false
         },
         "text": {},
@@ -2912,7 +2948,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 3: Median time to restore service \nwith 
_incidents as (\n-- get the incidents created within the selected time period 
in the top-right corner\n\tSELECT\n\t  distinct 
i.id,\n\t\tcast(lead_time_minutes as signed) as 
lead_time_minutes\n\tFROM\n\t\tissues i\n\t  join board_issues bi on i.id = 
bi.issue_id\n\t  join boards b on bi.board_id = b.id\n\t  join project_mapping 
pm on b.id = pm.row_id and pm.`table` = 'boards'\n\tWHERE\n\t  pm.project_name 
in (${projec [...]
+          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
           "refId": "A",
           "select": [
             [
@@ -2953,7 +2989,7 @@
           ]
         }
       ],
-      "title": "Figure 5 - Median Time to Restore Service",
+      "title": "Figure 5 - ${title_value}",
       "type": "stat"
     },
     {
@@ -3189,12 +3225,13 @@
       "targets": [
         {
           "datasource": "mysql",
+          "editorMode": "code",
           "format": "table",
           "group": [],
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "-- Metric 3: median time to restore service - MTTR\nwith 
_incidents as (\n-- get the number of incidents created each 
month\n\tSELECT\n\t  distinct i.id,\n\t\tdate_format(i.created_date,'%y/%m') as 
month,\n\t\tcast(lead_time_minutes as signed) as 
lead_time_minutes\n\tFROM\n\t\tissues i\n\t  join board_issues bi on i.id = 
bi.issue_id\n\t  join boards b on bi.board_id = b.id\n\t  join project_mapping 
pm on b.id = pm.row_id and pm.`table` = 'boards'\n\tWHERE\n\t  pm.pro [...]
+          "rawSql": "--  ***** 2023 report ***** --\n--  Metric 4: Failed 
deployment recovery time\nwith _deployments as (\n    SELECT\n        
cdc.cicd_deployment_id as deployment_id,\n        max(cdc.finished_date) as 
deployment_finished_date\n    FROM \n        cicd_deployment_commits cdc\n      
  JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'\n    WHERE\n        pm.project_name in ($project)\n        and 
cdc.result = 'SUCCESS'\n        and cdc [...]
           "refId": "A",
           "select": [
             [
@@ -3206,6 +3243,23 @@
               }
             ]
           ],
+          "sql": {
+            "columns": [
+              {
+                "parameters": [],
+                "type": "function"
+              }
+            ],
+            "groupBy": [
+              {
+                "property": {
+                  "type": "string"
+                },
+                "type": "groupBy"
+              }
+            ],
+            "limit": 50
+          },
           "table": "ae_projects",
           "timeColumn": "ae_create_time",
           "timeColumnType": "timestamp",
@@ -3218,7 +3272,7 @@
           ]
         }
       ],
-      "title": "Figure 6 - Median Time to Restore Service",
+      "title": "Figure 6 - ${title_value}",
       "type": "barchart"
     },
     {
@@ -3299,7 +3353,7 @@
           "calcs": [
             "lastNotNull"
           ],
-          "fields": "/^change_failure_rate$/",
+          "fields": "/.*/",
           "values": false
         },
         "text": {},
@@ -3315,7 +3369,7 @@
           "metricColumn": "none",
           "queryType": "randomWalk",
           "rawQuery": true,
-          "rawSql": "-- Metric 4: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\tJOIN proje [...]
+          "rawSql": "-- Metric 3: change failure rate\nwith _deployments as 
(\n-- When deploying multiple commits in one pipeline, GitLab and BitBucket may 
generate more than one deployment. However, DevLake consider these deployments 
as ONE production deployment and use the last one's finished_date as the 
finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\tJOIN proje [...]
           "refId": "A",
           "select": [
             [
@@ -3676,12 +3730,13 @@
       "targets": [
         {
           "datasource": "mysql",
+          "editorMode": "code",
           "format": "table",
           "group": [],
           "hide": false,
           "metricColumn": "none",
           "rawQuery": true,
-          "rawSql": "-- Metric 4: change failure rate per month\nwith 
_deployments as (\n-- When deploying multiple commits in one pipeline, GitLab 
and BitBucket may generate more than one deployment. However, DevLake consider 
these deployments as ONE production deployment and use the last one's 
finished_date as the finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\t [...]
+          "rawSql": "-- Metric 3: change failure rate per month\nwith 
_deployments as (\n-- When deploying multiple commits in one pipeline, GitLab 
and BitBucket may generate more than one deployment. However, DevLake consider 
these deployments as ONE production deployment and use the last one's 
finished_date as the finished date.\n\tSELECT\n\t\tcdc.cicd_deployment_id as 
deployment_id,\n\t\tmax(cdc.finished_date) as deployment_finished_date\n\tFROM 
\n\t\tcicd_deployment_commits cdc\n\t\t [...]
           "refId": "A",
           "select": [
             [
@@ -3693,6 +3748,23 @@
               }
             ]
           ],
+          "sql": {
+            "columns": [
+              {
+                "parameters": [],
+                "type": "function"
+              }
+            ],
+            "groupBy": [
+              {
+                "property": {
+                  "type": "string"
+                },
+                "type": "groupBy"
+              }
+            ],
+            "limit": 50
+          },
           "table": "ae_projects",
           "timeColumn": "ae_create_time",
           "timeColumnType": "timestamp",
@@ -3742,8 +3814,8 @@
       {
         "current": {
           "selected": false,
-          "text": "https://github.com/apache/incubator-devlake/pull/5799";,
-          "value": "github:GithubPullRequest:1:1460714136"
+          "text": "https://github.com/apache/incubator-devlake/pull/5913";,
+          "value": "github:GithubPullRequest:1:1480194863"
         },
         "datasource": "mysql",
         "definition": "select concat(Url, '--', id) from pull_requests",
@@ -3762,19 +3834,40 @@
       },
       {
         "current": {
-          "selected": false,
-          "text": "2023 report",
-          "value": "2023 report"
+          "selected": true,
+          "text": "2023",
+          "value": "2023"
         },
         "datasource": "mysql",
-        "definition": "select benchmarks from dora_benchmarks",
+        "definition": "select dora_report from dora_benchmarks",
         "hide": 0,
         "includeAll": false,
-        "label": "Benchmarks",
+        "label": "DORA Report",
+        "multi": false,
+        "name": "dora_report",
+        "options": [],
+        "query": "select dora_report from dora_benchmarks",
+        "refresh": 1,
+        "regex": "",
+        "skipUrlSync": false,
+        "sort": 0,
+        "type": "query"
+      },
+      {
+        "current": {
+          "selected": false,
+          "text": "Failed Deployment Recovery Time",
+          "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}'",
+        "hide": 2,
+        "includeAll": false,
+        "label": "TitleValue",
         "multi": false,
-        "name": "benchmarks",
+        "name": "title_value",
         "options": [],
-        "query": "select benchmarks from dora_benchmarks",
+        "query": "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}'",
         "refresh": 1,
         "regex": "",
         "skipUrlSync": false,
@@ -3791,6 +3884,6 @@
   "timezone": "",
   "title": "DORA Validation",
   "uid": "KGkUnV-Vz",
-  "version": 2,
+  "version": 3,
   "weekStart": ""
 }
\ No newline at end of file


Reply via email to