This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch feat#6794
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/feat#6794 by this push:
new 1e4944b00 feat: upgrade dora benchmarks to 2023 version
1e4944b00 is described below
commit 1e4944b00074bf712c92a5e950d6bfe069a394c4
Author: abeizn <[email protected]>
AuthorDate: Tue Jan 30 14:54:57 2024 +0800
feat: upgrade dora benchmarks to 2023 version
---
.../20240130_upgrade_dora_benchmark_metric.go | 53 ++++
.../dora/models/migrationscripts/register.go | 1 +
grafana/dashboards/DORA.json | 340 ++++++++++++++++-----
grafana/dashboards/DORAByTeam.json | 80 +++--
4 files changed, 356 insertions(+), 118 deletions(-)
diff --git
a/backend/plugins/dora/models/migrationscripts/20240130_upgrade_dora_benchmark_metric.go
b/backend/plugins/dora/models/migrationscripts/20240130_upgrade_dora_benchmark_metric.go
new file mode 100644
index 000000000..53a611c0b
--- /dev/null
+++
b/backend/plugins/dora/models/migrationscripts/20240130_upgrade_dora_benchmark_metric.go
@@ -0,0 +1,53 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+ "github.com/apache/incubator-devlake/core/context"
+ "github.com/apache/incubator-devlake/core/errors"
+)
+
+type upgradeDoraBenchmarkMetric struct{}
+
+func (u *upgradeDoraBenchmarkMetric) Up(baseRes context.BasicRes) errors.Error
{
+ db := baseRes.GetDal()
+ err := db.Exec("UPDATE dora_benchmarks SET low = 'Fewer than once per
month', medium = 'Between once per week and per month', high = 'Between once
per day and per week' WHERE id = 1")
+ if err != nil {
+ return err
+ }
+
+ err = db.Exec("UPDATE dora_benchmarks SET low = 'More than one month',
medium = 'Between one week and one month', high = 'Between one day and one
week', elite = 'Less than one day' WHERE id = 2")
+ if err != nil {
+ return err
+ }
+
+ err = db.Exec("UPDATE dora_benchmarks SET low = '> 15%', medium =
'10%-15%', high = '5%-10%', elite = '0-5%' WHERE id = 4")
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (*upgradeDoraBenchmarkMetric) Version() uint64 {
+ return 20240130000002
+}
+
+func (*upgradeDoraBenchmarkMetric) Name() string {
+ return "upgrade dora benchmark version to 2023 dora benchmark"
+}
diff --git a/backend/plugins/dora/models/migrationscripts/register.go
b/backend/plugins/dora/models/migrationscripts/register.go
index 1d7fb7bf8..8de1c48e9 100644
--- a/backend/plugins/dora/models/migrationscripts/register.go
+++ b/backend/plugins/dora/models/migrationscripts/register.go
@@ -26,5 +26,6 @@ func All() []plugin.MigrationScript {
return []plugin.MigrationScript{
new(addDoraBenchmark),
new(fixDoraBenchmarkMetric),
+ new(upgradeDoraBenchmarkMetric),
}
}
diff --git a/grafana/dashboards/DORA.json b/grafana/dashboards/DORA.json
index 89460d083..cbce88df0 100644
--- a/grafana/dashboards/DORA.json
+++ b/grafana/dashboards/DORA.json
@@ -3,7 +3,10 @@
"list": [
{
"builtIn": 1,
- "datasource": "-- Grafana --",
+ "datasource": {
+ "type": "datasource",
+ "uid": "grafana"
+ },
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
@@ -13,14 +16,17 @@
]
},
"editable": true,
- "gnetId": null,
+ "fiscalYearStartMonth": 0,
"graphTooltip": 0,
- "id": 21,
- "iteration": 1684326672244,
+ "id": 31,
"links": [],
+ "liveNow": false,
"panels": [
{
- "datasource": null,
+ "datasource": {
+ "type": "datasource",
+ "uid": "grafana"
+ },
"gridPos": {
"h": 6,
"w": 24,
@@ -30,12 +36,21 @@
"id": 16,
"links": [],
"options": {
+ "code": {
+ "language": "plaintext",
+ "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/ [...]
"mode": "markdown"
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": {
+ "type": "datasource",
+ "uid": "grafana"
+ },
"queryType": "randomWalk",
"refId": "A"
}
@@ -54,8 +69,11 @@
},
"custom": {
"align": "auto",
- "displayMode": "auto",
- "filterable": false
+ "cellOptions": {
+ "type": "auto"
+ },
+ "filterable": false,
+ "inspect": false
},
"mappings": [],
"noValue": "-",
@@ -77,8 +95,10 @@
},
"properties": [
{
- "id": "custom.displayMode",
- "value": "color-text"
+ "id": "custom.cellOptions",
+ "value": {
+ "type": "color-text"
+ }
},
{
"id": "color",
@@ -96,8 +116,10 @@
},
"properties": [
{
- "id": "custom.displayMode",
- "value": "color-text"
+ "id": "custom.cellOptions",
+ "value": {
+ "type": "color-text"
+ }
},
{
"id": "color",
@@ -115,8 +137,10 @@
},
"properties": [
{
- "id": "custom.displayMode",
- "value": "color-text"
+ "id": "custom.cellOptions",
+ "value": {
+ "type": "color-text"
+ }
},
{
"id": "color",
@@ -134,8 +158,10 @@
},
"properties": [
{
- "id": "custom.displayMode",
- "value": "color-text"
+ "id": "custom.cellOptions",
+ "value": {
+ "type": "color-text"
+ }
},
{
"id": "color",
@@ -157,18 +183,29 @@
"id": 8,
"links": [],
"options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
"showHeader": true,
"sortBy": []
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": "mysql",
+ "editorMode": "code",
"format": "table",
"group": [],
"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": [
[
@@ -180,6 +217,23 @@
}
]
],
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
"table": "_devlake_blueprints",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
@@ -205,15 +259,15 @@
"mappings": [
{
"options": {
- "Between once per month and once every 6 months": {
- "color": "yellow",
- "index": 1
- },
- "Between once per week and once per month": {
+ "Between once per day and per week": {
"color": "green",
"index": 2
},
- "Fewer than once per six months": {
+ "Between one week and one month": {
+ "color": "yellow",
+ "index": 1
+ },
+ "Fewer than once per month": {
"color": "red",
"index": 0
},
@@ -260,15 +314,17 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": "mysql",
+ "editorMode": "code",
"format": "table",
"group": [],
"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": [
[
@@ -280,6 +336,23 @@
}
]
],
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
"table": "_devlake_tasks",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
@@ -305,19 +378,19 @@
"mappings": [
{
"options": {
- "Between one week and six months": {
+ "Between one day and one week": {
+ "color": "green",
+ "index": 2
+ },
+ "Between one week and one month": {
"color": "yellow",
"index": 1
},
- "Less than one hour": {
+ "Less than one day": {
"color": "purple",
"index": 3
},
- "Less than one week": {
- "color": "green",
- "index": 2
- },
- "More than six months": {
+ "More than one month": {
"color": "red",
"index": 0
}
@@ -360,15 +433,17 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": "mysql",
+ "editorMode": "code",
"format": "table",
"group": [],
"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": [
[
@@ -380,6 +455,23 @@
}
]
],
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
"table": "_devlake_tasks",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
@@ -464,15 +556,17 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": "mysql",
+ "editorMode": "code",
"format": "table",
"group": [],
"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": "-- 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 ($project [...]
"refId": "A",
"select": [
[
@@ -484,6 +578,23 @@
}
]
],
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
"table": "_devlake_tasks",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
@@ -509,19 +620,19 @@
"mappings": [
{
"options": {
- "0-15%": {
+ "0-5%": {
"color": "purple",
"index": 3
},
- "16%-20%": {
- "color": "green",
- "index": 2
- },
- "21%-30%": {
+ "10%-15%": {
"color": "yellow",
"index": 1
},
- "> 30%": {
+ "5%-10%": {
+ "color": "green",
+ "index": 2
+ },
+ "> 15%": {
"color": "red",
"index": 0
}
@@ -564,15 +675,17 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "8.0.6",
+ "pluginVersion": "9.5.15",
"targets": [
{
+ "datasource": "mysql",
+ "editorMode": "code",
"format": "table",
"group": [],
"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 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 [...]
"refId": "A",
"select": [
[
@@ -584,6 +697,23 @@
}
]
],
+ "sql": {
+ "columns": [
+ {
+ "parameters": [],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
"table": "_devlake_tasks",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
@@ -607,6 +737,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
@@ -617,7 +749,13 @@
"tooltip": false,
"viz": false
},
- "lineWidth": 1
+ "lineWidth": 1,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"mappings": [],
"thresholds": {
@@ -645,28 +783,36 @@
"id": 2,
"links": [],
"options": {
+ "barRadius": 0,
"barWidth": 0.6,
+ "fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
- "placement": "bottom"
+ "placement": "bottom",
+ "showLegend": true
},
"orientation": "auto",
"showValue": "auto",
+ "stacking": "none",
"text": {},
"tooltip": {
- "mode": "single"
- }
+ "mode": "single",
+ "sort": "none"
+ },
+ "xTickLabelRotation": 0,
+ "xTickLabelSpacing": 0
},
"targets": [
{
+ "datasource": "mysql",
"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": [
[
@@ -702,6 +848,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "Hours",
"axisPlacement": "auto",
"axisSoftMin": 0,
@@ -712,7 +860,13 @@
"tooltip": false,
"viz": false
},
- "lineWidth": 1
+ "lineWidth": 1,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"mappings": [],
"thresholds": {
@@ -736,29 +890,37 @@
"id": 6,
"links": [],
"options": {
+ "barRadius": 0,
"barWidth": 0.7,
+ "fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
- "placement": "bottom"
+ "placement": "bottom",
+ "showLegend": true
},
"orientation": "auto",
"showValue": "auto",
+ "stacking": "none",
"text": {},
"tooltip": {
- "mode": "single"
- }
+ "mode": "single",
+ "sort": "none"
+ },
+ "xTickLabelRotation": 0,
+ "xTickLabelSpacing": 0
},
"pluginVersion": "8.0.6",
"targets": [
{
+ "datasource": "mysql",
"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": [
[
@@ -782,8 +944,6 @@
]
}
],
- "timeFrom": null,
- "timeShift": null,
"title": "Median Lead Time for Changes",
"type": "barchart"
},
@@ -796,6 +956,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "Hours",
"axisPlacement": "auto",
"axisSoftMin": 0,
@@ -806,7 +968,13 @@
"tooltip": false,
"viz": false
},
- "lineWidth": 1
+ "lineWidth": 1,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"mappings": [],
"thresholds": {
@@ -851,29 +1019,37 @@
"id": 9,
"links": [],
"options": {
+ "barRadius": 0,
"barWidth": 0.6,
+ "fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
- "placement": "bottom"
+ "placement": "bottom",
+ "showLegend": true
},
"orientation": "auto",
"showValue": "auto",
+ "stacking": "none",
"text": {},
"tooltip": {
- "mode": "single"
- }
+ "mode": "single",
+ "sort": "none"
+ },
+ "xTickLabelRotation": 0,
+ "xTickLabelSpacing": 0
},
"pluginVersion": "8.0.6",
"targets": [
{
+ "datasource": "mysql",
"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": "-- 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 [...]
"refId": "A",
"select": [
[
@@ -897,8 +1073,6 @@
]
}
],
- "timeFrom": null,
- "timeShift": null,
"title": "Median Time to Restore Service",
"type": "barchart"
},
@@ -911,6 +1085,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
@@ -921,7 +1097,13 @@
"tooltip": false,
"viz": false
},
- "lineWidth": 1
+ "lineWidth": 1,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
},
"mappings": [],
"max": 1,
@@ -964,31 +1146,39 @@
"id": 5,
"links": [],
"options": {
+ "barRadius": 0,
"barWidth": 0.6,
+ "fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
- "placement": "bottom"
+ "placement": "bottom",
+ "showLegend": true
},
"orientation": "auto",
"showValue": "auto",
+ "stacking": "none",
"text": {
"valueSize": 12
},
"tooltip": {
- "mode": "single"
- }
+ "mode": "single",
+ "sort": "none"
+ },
+ "xTickLabelRotation": 0,
+ "xTickLabelSpacing": 0
},
"pluginVersion": "8.0.6",
"targets": [
{
+ "datasource": "mysql",
"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 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 [...]
"refId": "A",
"select": [
[
@@ -1012,14 +1202,12 @@
]
}
],
- "timeFrom": null,
- "timeShift": null,
"title": "Change Failure Rate",
"type": "barchart"
}
],
"refresh": "",
- "schemaVersion": 30,
+ "schemaVersion": 38,
"style": "dark",
"tags": [
"Engineering Leads Dashboard",
@@ -1028,7 +1216,6 @@
"templating": {
"list": [
{
- "allValue": null,
"current": {
"selected": true,
"text": [
@@ -1040,8 +1227,6 @@
},
"datasource": "mysql",
"definition": "select distinct name from projects",
- "description": null,
- "error": null,
"hide": 0,
"includeAll": true,
"label": "Project",
@@ -1065,5 +1250,6 @@
"timezone": "",
"title": "DORA",
"uid": "qNo8_0M4z",
- "version": 11
+ "version": 11,
+ "weekStart": ""
}
\ No newline at end of file
diff --git a/grafana/dashboards/DORAByTeam.json
b/grafana/dashboards/DORAByTeam.json
index d66f4b526..ab68325ea 100644
--- a/grafana/dashboards/DORAByTeam.json
+++ b/grafana/dashboards/DORAByTeam.json
@@ -24,7 +24,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
- "id": 8,
+ "id": 23,
"links": [],
"liveNow": false,
"panels": [
@@ -50,7 +50,7 @@
"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.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": {
@@ -200,7 +200,7 @@
"showHeader": true,
"sortBy": []
},
- "pluginVersion": "9.5.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": "mysql",
@@ -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": [
@@ -242,15 +242,15 @@
"mappings": [
{
"options": {
- "Between once per month and once every 6 months": {
- "color": "yellow",
- "index": 1
- },
- "Between once per week and once per month": {
+ "Between once per day and per week": {
"color": "green",
"index": 2
},
- "Fewer than once per six months": {
+ "Between once per week and per month": {
+ "color": "yellow",
+ "index": 1
+ },
+ "Fewer than once per month": {
"color": "red",
"index": 0
},
@@ -297,7 +297,7 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "9.5.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": "mysql",
@@ -307,7 +307,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": [
[
@@ -361,19 +361,19 @@
"mappings": [
{
"options": {
- "Between one week and six months": {
+ "Between one day and one week": {
+ "color": "green",
+ "index": 2
+ },
+ "Between one week and one month": {
"color": "yellow",
"index": 1
},
- "Less than one hour": {
+ "Less than one day": {
"color": "purple",
"index": 3
},
- "Less than one week": {
- "color": "green",
- "index": 2
- },
- "More than six months": {
+ "More than one month": {
"color": "red",
"index": 0
}
@@ -416,7 +416,7 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "9.5.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": "mysql",
@@ -424,7 +424,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": [
@@ -517,7 +517,7 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "9.5.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": "mysql",
@@ -525,7 +525,7 @@
"format": "table",
"hide": false,
"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\t join user_accounts ua on
i.assignee_i [...]
+ "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\t join user_accounts ua on
i.assignee_i [...]
"refId": "A",
"sql": {
"columns": [
@@ -559,19 +559,19 @@
"mappings": [
{
"options": {
- "0-15%": {
+ "0-5%": {
"color": "purple",
"index": 3
},
- "16%-20%": {
- "color": "green",
- "index": 2
- },
- "21%-30%": {
+ "10%-15%": {
"color": "yellow",
"index": 1
},
- "> 30%": {
+ "5%-10%": {
+ "color": "green",
+ "index": 2
+ },
+ "> 15%": {
"color": "red",
"index": 0
}
@@ -614,7 +614,7 @@
"text": {},
"textMode": "auto"
},
- "pluginVersion": "9.5.1",
+ "pluginVersion": "9.5.15",
"targets": [
{
"datasource": "mysql",
@@ -622,7 +622,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": [
@@ -728,7 +728,7 @@
"format": "table",
"hide": false,
"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",
"sql": {
"columns": [
@@ -832,7 +832,7 @@
"format": "table",
"hide": false,
"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
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 [...]
+ "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
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 [...]
"refId": "A",
"sql": {
"columns": [
@@ -890,8 +890,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -957,7 +956,7 @@
"format": "table",
"hide": false,
"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\t join user_accou [...]
+ "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\t join user_accou [...]
"refId": "A",
"sql": {
"columns": [
@@ -1017,8 +1016,7 @@
"mode": "percentage",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
}
]
},
@@ -1080,7 +1078,7 @@
"format": "table",
"hide": false,
"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 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 [...]
"refId": "A",
"sql": {
"columns": [
@@ -1144,6 +1142,6 @@
"timezone": "",
"title": "DORA (by Team)",
"uid": "66YkL8y4z",
- "version": 33,
+ "version": 5,
"weekStart": ""
}
\ No newline at end of file