This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new e4e8ead26 fix(grafana): exclude PRs without a metrics row from PR time
panels (#9226)
e4e8ead26 is described below
commit e4e8ead260bc87ef698a2ba586ea99072d6c1e5a
Author: AwEi <[email protected]>
AuthorDate: Sun Oct 18 13:01:04 2026 +0800
fix(grafana): exclude PRs without a metrics row from PR time panels (#9226)
The PR time panels of the Engineering Throughput and Cycle Time
dashboards (and the team view) LEFT JOIN project_pr_metrics and
coalesce the metric to 0, so a merged PR without a project_pr_metrics
row was averaged in as 0 hours. Projects without DORA enabled showed a
flat 0 h on every panel.
Inner join project_pr_metrics in the MySQL and PostgreSQL variants so
those PRs are excluded. Projects where every merged PR has a row get
the same values as before, and NULL sub-metrics within a row are still
treated as 0.
Closes #9225
---
.../mysql/engineering-throughput-and-cycle-time-team-view.json | 10 +++++-----
.../mysql/engineering-throughput-and-cycle-time.json | 10 +++++-----
.../engineering-throughput-and-cycle-time-team-view.json | 10 +++++-----
.../postgresql/engineering-throughput-and-cycle-time.json | 10 +++++-----
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git
a/grafana/dashboards/mysql/engineering-throughput-and-cycle-time-team-view.json
b/grafana/dashboards/mysql/engineering-throughput-and-cycle-time-team-view.json
index 175b18b61..80c268240 100644
---
a/grafana/dashboards/mysql/engineering-throughput-and-cycle-time-team-view.json
+++
b/grafana/dashboards/mysql/engineering-throughput-and-cycle-time-team-view.json
@@ -2335,7 +2335,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n
u.id as user_id,\n u.name as user_name,\n t.id as team_id,\n t.name
as team\n FROM pull_requests pr\n join project_mapping pm on
pr.base_repo_id = pm.row_id and pm.table = 'repos' \n\t\tlef [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n
u.id as user_id,\n u.name as user_name,\n t.id as team_id,\n t.name
as team\n FROM pull_requests pr\n join project_mapping pm on
pr.base_repo_id = pm.row_id and pm.table = 'repos' \n\t\tjoi [...]
"refId": "A",
"select": [
[
@@ -2502,7 +2502,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tle [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tjo [...]
"refId": "A",
"select": [
[
@@ -2669,7 +2669,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tle [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tjo [...]
"refId": "A",
"select": [
[
@@ -2836,7 +2836,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tle [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tjo [...]
"refId": "A",
"select": [
[
@@ -3003,7 +3003,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tle [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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\t\tpr.author_id,\n u.id as user_id,\n u.name as
user_name,\n t.id as team_id,\n t.name as team\n FROM pull_requests pr\n
join project_mapping pm on pr.base_repo_id = pm.row_id and pm.table =
'repos' \n\t\tjo [...]
"refId": "A",
"select": [
[
diff --git
a/grafana/dashboards/mysql/engineering-throughput-and-cycle-time.json
b/grafana/dashboards/mysql/engineering-throughput-and-cycle-time.json
index 3db70532c..c1e59bb48 100644
--- a/grafana/dashboards/mysql/engineering-throughput-and-cycle-time.json
+++ b/grafana/dashboards/mysql/engineering-throughput-and-cycle-time.json
@@ -1149,7 +1149,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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.merged_date)\n and pr.create [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 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.merged_date)\n and pr.created_dat [...]
"refId": "A",
"select": [
[
@@ -1285,7 +1285,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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.merged_date)\n and pr.merge [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 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.merged_date)\n and pr.merged_dat [...]
"refId": "A",
"select": [
[
@@ -1452,7 +1452,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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.merged_date)\n and pr.merge [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 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.merged_date)\n and pr.merged_dat [...]
"refId": "A",
"select": [
[
@@ -1619,7 +1619,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 pr.merg [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 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 pr.merged_da [...]
"refId": "A",
"select": [
[
@@ -1786,7 +1786,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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.merged_date)\n and pr.merge [...]
+ "rawSql": "with _prs as(\n SELECT\n pr.id,\n pr.merged_date
as pr_merged_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 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.merged_date)\n and pr.merged_dat [...]
"refId": "A",
"select": [
[
diff --git
a/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time-team-view.json
b/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time-team-view.json
index 2e45236b1..b430f15e4 100644
---
a/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time-team-view.json
+++
b/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time-team-view.json
@@ -2335,7 +2335,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_cycle_time AS NUMERIC) / NULLIF(60, 0), 0)
AS cycle_time /* convert null to 0 if a PR has no cycle_time to make sure
cycle_time equals the sum of the four metrics below */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' LEFT JOIN project_pr_metr [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_cycle_time AS NUMERIC) / NULLIF(60, 0), 0)
AS cycle_time /* convert null to 0 if a PR has no cycle_time to make sure
cycle_time equals the sum of the four metrics below */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' JOIN project_pr_metrics A [...]
"refId": "A",
"select": [
[
@@ -2502,7 +2502,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_coding_time AS NUMERIC) / NULLIF(60, 0),
0) AS coding_time /* convert null to 0 if a PR has no coding_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' LEFT JOIN project_pr_met [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_coding_time AS NUMERIC) / NULLIF(60, 0),
0) AS coding_time /* convert null to 0 if a PR has no coding_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' JOIN project_pr_metrics [...]
"refId": "A",
"select": [
[
@@ -2669,7 +2669,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_pickup_time AS NUMERIC) / NULLIF(60, 0),
0) AS pickup_time /* convert null to 0 if a PR has no pickup_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' LEFT JOIN project_pr_met [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_pickup_time AS NUMERIC) / NULLIF(60, 0),
0) AS pickup_time /* convert null to 0 if a PR has no pickup_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' JOIN project_pr_metrics [...]
"refId": "A",
"select": [
[
@@ -2836,7 +2836,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_review_time AS NUMERIC) / NULLIF(60, 0),
0) AS review_time /* convert null to 0 if a PR has no review_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' LEFT JOIN project_pr_met [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_review_time AS NUMERIC) / NULLIF(60, 0),
0) AS review_time /* convert null to 0 if a PR has no review_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' JOIN project_pr_metrics [...]
"refId": "A",
"select": [
[
@@ -3003,7 +3003,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_deploy_time AS NUMERIC) / NULLIF(60, 0),
0) AS deploy_time /* convert null to 0 if a PR has no deploy_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' LEFT JOIN project_pr_met [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_deploy_time AS NUMERIC) / NULLIF(60, 0),
0) AS deploy_time /* convert null to 0 if a PR has no deploy_time to make sure
cycle_time equals the sum of the four sub-metrics */, pr.author_id, u.id AS
user_id, u.name AS user_name, t.id AS team_id, t.name AS team FROM
pull_requests AS pr JOIN project_mapping AS pm ON pr.base_repo_id = pm.row_id
AND pm.table = 'repos' JOIN project_pr_metrics [...]
"refId": "A",
"select": [
[
diff --git
a/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time.json
b/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time.json
index 6abd47e0a..5aa346dc9 100644
--- a/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time.json
+++ b/grafana/dashboards/postgresql/engineering-throughput-and-cycle-time.json
@@ -1149,7 +1149,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_cycle_time AS NUMERIC) / NULLIF(60, 0), 0)
AS cycle_time /* convert null to 0 if a PR has no cycle_time to make sure
cycle_time equals the sum of the four metrics below */ FROM pull_requests AS pr
LEFT JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS
pm ON pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.created_date [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_cycle_time AS NUMERIC) / NULLIF(60, 0), 0)
AS cycle_time /* convert null to 0 if a PR has no cycle_time to make sure
cycle_time equals the sum of the four metrics below */ FROM pull_requests AS pr
JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS pm ON
pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.created_date >= $_ [...]
"refId": "A",
"select": [
[
@@ -1285,7 +1285,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_coding_time AS NUMERIC) / NULLIF(60, 0),
0) AS coding_time /* convert null to 0 if a PR has no coding_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
LEFT JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS
pm ON pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_coding_time AS NUMERIC) / NULLIF(60, 0),
0) AS coding_time /* convert null to 0 if a PR has no coding_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS pm ON
pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date >= $_ [...]
"refId": "A",
"select": [
[
@@ -1452,7 +1452,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_pickup_time AS NUMERIC) / NULLIF(60, 0),
0) AS pickup_time /* convert null to 0 if a PR has no pickup_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
LEFT JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS
pm ON pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_pickup_time AS NUMERIC) / NULLIF(60, 0),
0) AS pickup_time /* convert null to 0 if a PR has no pickup_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS pm ON
pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date >= $_ [...]
"refId": "A",
"select": [
[
@@ -1619,7 +1619,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_review_time AS NUMERIC) / NULLIF(60, 0),
0) AS review_time /* convert null to 0 if a PR has no review_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
LEFT JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS
pm ON pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.created_date) AND pr.merged_date [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_review_time AS NUMERIC) / NULLIF(60, 0),
0) AS review_time /* convert null to 0 if a PR has no review_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS pm ON
pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.created_date) AND pr.merged_date >= $ [...]
"refId": "A",
"select": [
[
@@ -1786,7 +1786,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
- "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_deploy_time AS NUMERIC) / NULLIF(60, 0),
0) AS deploy_time /* convert null to 0 if a PR has no deploy_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
LEFT JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS
pm ON pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date [...]
+ "rawSql": "WITH _prs AS (SELECT pr.id, pr.merged_date AS
pr_merged_date, COALESCE(CAST(prm.pr_deploy_time AS NUMERIC) / NULLIF(60, 0),
0) AS deploy_time /* convert null to 0 if a PR has no deploy_time to make sure
cycle_time equals the sum of the four sub-metrics */ FROM pull_requests AS pr
JOIN project_pr_metrics AS prm ON pr.id = prm.id JOIN project_mapping AS pm ON
pr.base_repo_id = pm.row_id AND pm.table = 'repos' WHERE
$__timeFilter(pr.merged_date) AND pr.merged_date >= $_ [...]
"refId": "A",
"select": [
[