Skip to content

Commit 3ebafbd

Browse files
committed
fix: gitlab case inconsistency in dashboard sql (#4999)
1 parent 9af4124 commit 3ebafbd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

grafana/dashboards/Gitlab.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"gnetId": null,
1717
"graphTooltip": 0,
1818
"id": 26,
19-
"iteration": 1682063010710,
19+
"iteration": 1677590524546,
2020
"links": [],
2121
"panels": [
2222
{
@@ -306,7 +306,7 @@
306306
"hide": false,
307307
"metricColumn": "none",
308308
"rawQuery": true,
309-
"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",
309+
"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",
310310
"refId": "A",
311311
"select": [
312312
[
@@ -401,7 +401,7 @@
401401
"hide": false,
402402
"metricColumn": "none",
403403
"rawQuery": true,
404-
"rawSql": "select\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') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)",
404+
"rawSql": "select\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') then id else null end) as ratio\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)",
405405
"refId": "A",
406406
"select": [
407407
[
@@ -504,7 +504,7 @@
504504
"hide": false,
505505
"metricColumn": "none",
506506
"rawQuery": true,
507-
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status not in ('CLOSED', 'MERGED') 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') and merged_date is not null then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\ngroup by 1\n",
507+
"rawSql": "SELECT\n DATE_ADD(date(created_date), INTERVAL -DAYOFMONTH(date(created_date))+1 DAY) as time,\n count(distinct case when status not in ('closed','merged') 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') and merged_date is not null then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\ngroup by 1\n",
508508
"refId": "A",
509509
"select": [
510510
[
@@ -586,7 +586,7 @@
586586
"hide": false,
587587
"metricColumn": "none",
588588
"rawQuery": true,
589-
"rawSql": "select\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 null",
589+
"rawSql": "select\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 null",
590590
"refId": "A",
591591
"select": [
592592
[
@@ -693,7 +693,7 @@
693693
"hide": false,
694694
"metricColumn": "none",
695695
"rawQuery": true,
696-
"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",
696+
"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",
697697
"refId": "A",
698698
"select": [
699699
[
@@ -952,7 +952,7 @@
952952
"hide": false,
953953
"metricColumn": "none",
954954
"rawQuery": true,
955-
"rawSql": "select\n\tavg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\nfrom \n\tpull_requests\nwhere \n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand status in ('CLOSED', 'MERGED')\n\n\n",
955+
"rawSql": "select\n\tavg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\nfrom \n\tpull_requests\nwhere \n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand status in ('closed', 'merged')\n\n\n",
956956
"refId": "A",
957957
"select": [
958958
[
@@ -1049,7 +1049,7 @@
10491049
"hide": false,
10501050
"metricColumn": "none",
10511051
"rawQuery": true,
1052-
"rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\n and status in ('CLOSED', 'MERGED')\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_close as \"Time to Close\"\nFROM _prs\nORDER BY time\n",
1052+
"rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n avg(TIMESTAMPDIFF(Minute,created_date,closed_date)/1440) as time_to_close\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in ($repo_id)\n and status in ('closed', 'merged')\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n time_to_close as \"Time to Close\"\nFROM _prs\nORDER BY time\n",
10531053
"refId": "A",
10541054
"select": [
10551055
[
@@ -1143,5 +1143,5 @@
11431143
"timezone": "",
11441144
"title": "GitLab",
11451145
"uid": "msSjEq97z",
1146-
"version": 11
1146+
"version": 10
11471147
}

0 commit comments

Comments
 (0)