Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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\tleft join project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then cycle_time end) as 'Team1: Avg Cycle Time(h)',\n avg(case when team_id in (${team2:singlequote}) then cycle_time end) as 'Team2: Avg Cycle Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"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\tjoin project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then cycle_time end) as 'Team1: Avg Cycle Time(h)',\n avg(case when team_id in (${team2:singlequote}) then cycle_time end) as 'Team2: Avg Cycle Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -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\tleft join project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then coding_time end) as 'Team1: Avg Coding Time(h)',\n avg(case when team_id in (${team2:singlequote}) then coding_time end) as 'Team2: Avg Coding Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"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\tjoin project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then coding_time end) as 'Team1: Avg Coding Time(h)',\n avg(case when team_id in (${team2:singlequote}) then coding_time end) as 'Team2: Avg Coding Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -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\tleft join project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then pickup_time end) as 'Team1: Avg Pickup Time(h)',\n avg(case when team_id in (${team2:singlequote}) then pickup_time end) as 'Team2: Avg Pickup Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"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\tjoin project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then pickup_time end) as 'Team1: Avg Pickup Time(h)',\n avg(case when team_id in (${team2:singlequote}) then pickup_time end) as 'Team2: Avg Pickup Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -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\tleft join project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then review_time end) as 'Team1: Avg Review Time(h)',\n avg(case when team_id in (${team2:singlequote}) then review_time end) as 'Team2: Avg Review Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"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\tjoin project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then review_time end) as 'Team1: Avg Review Time(h)',\n avg(case when team_id in (${team2:singlequote}) then review_time end) as 'Team2: Avg Review Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -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\tleft join project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then deploy_time end) as 'Team1: Avg Deploy Time(h)',\n avg(case when team_id in (${team2:singlequote}) then deploy_time end) as 'Team2: Avg Deploy Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"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\tjoin project_pr_metrics prm on pr.id = prm.id\n left join user_accounts ua on pr.author_id = ua.account_id\n left join users u on ua.user_id = u.id\n left join team_users tu on u.id = tu.user_id\n left join teams t on tu.team_id = t.id\n WHERE\n $__timeFilter(pr.merged_date)\n and pm.project_name in (${project})\n GROUP BY 1,2,3,4,5,6,7,8\n)\n\nSELECT \n DATE_ADD(date(pr_merged_date), INTERVAL -$interval(date(pr_merged_date))+1 DAY) as time,\n avg(case when team_id in (${team1:singlequote}) then deploy_time end) as 'Team1: Avg Deploy Time(h)',\n avg(case when team_id in (${team2:singlequote}) then deploy_time end) as 'Team2: Avg Deploy Time(h)'\nFROM _prs\nGROUP BY 1\nORDER BY 1",
"refId": "A",
"select": [
[
Expand Down
Loading
Loading