-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: updated pr-status-related dashboards #5144
Conversation
@@ -672,7 +672,7 @@ | |||
"metricColumn": "none", | |||
"queryType": "randomWalk", | |||
"rawQuery": true, | |||
"rawSql": "select\n 100 * count(distinct case when status in ('CLOSED', 'MERGED', 'DECLINED') and merged_date is null then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED', 'DECLINED') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n date(created_date) BETWEEN\n curdate() - INTERVAL DAYOFMONTH(curdate())-1 DAY - INTERVAL 1 month and\n curdate() - INTERVAL DAYOFMONTH(curdate()) DAY\n and pr.base_repo_id in ($repo_id)", | |||
"rawSql": "select\n 100 * count(distinct case when status in ('CLOSED', 'MERGED') and merged_date is null then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED', 'DECLINED') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n date(created_date) BETWEEN\n curdate() - INTERVAL DAYOFMONTH(curdate())-1 DAY - INTERVAL 1 month and\n curdate() - INTERVAL DAYOFMONTH(curdate()) DAY\n and pr.base_repo_id in ($repo_id)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be:
"rawSql": "select\n 100 * count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end)
grafana/dashboards/GitHub.json
Outdated
@@ -1362,7 +1362,7 @@ | |||
"hide": false, | |||
"metricColumn": "none", | |||
"rawQuery": true, | |||
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status != 'CLOSED' then id else null end) as \"PR: Open\",\n count(distinct case when status in ('CLOSED', 'MERGED') and merged_date is null then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as \"PR: Closed and merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in ($repo_id)\ngroup by 1\n", | |||
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'OPEN' then id else null end) as \"PR: Open\",\n count(distinct case when status = 'CLOSED' then id else null end) as \"PR: Closed without merging\",\n count(distinct case when status in ('CLOSED', 'MERGED') then id else null end) as \"PR: Closed and merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n and base_repo_id in ($repo_id)\ngroup by 1\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be:
count(distinct case when status = 'MERGED' then id else null end) as "PR: Closed and merged"
grafana/dashboards/Gitlab.json
Outdated
@@ -306,7 +306,7 @@ | |||
"hide": false, | |||
"metricColumn": "none", | |||
"rawQuery": true, | |||
"rawSql": "select\n author_name,\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status in ('closed', 'merged') and pr.merged_date is not null\ngroup by 1\norder by 2 desc\nlimit 20\n", | |||
"rawSql": "select\n author_name,\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'CLOSED'\ngroup by 1\norder by 2 desc\nlimit 20\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be:
base_repo_id in ($repo_id)\n\tand pr.status = 'MERGED'
grafana/dashboards/Gitlab.json
Outdated
@@ -693,7 +693,7 @@ | |||
"hide": false, | |||
"metricColumn": "none", | |||
"rawQuery": true, | |||
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status in ('closed', 'merged') and merged_date is null then id else null end)/count(distinct case when status in ('closed', 'merged') and merged_date is not null then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\ngroup by 1\n", | |||
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') and merged_date is not null then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\ngroup by 1\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be:
count(distinct case when status = 'CLOSED' then id else null end)/count(distinct case when status in ('CLOSED', 'MERGED') then id else null end)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
updated pr-status-realated metrics
Does this close any open issues?
part of #4745
Screenshots
Other Information
Any other information that is important to this PR.