Skip to content

Commit

Permalink
feat(dashboard): revert changes that try to remove wanings (#6948)
Browse files Browse the repository at this point in the history
  • Loading branch information
d4x1 authored Feb 9, 2024
1 parent 3970ecf commit a959768
Show file tree
Hide file tree
Showing 25 changed files with 296 additions and 296 deletions.
32 changes: 16 additions & 16 deletions grafana/dashboards/AzureDevOps.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions grafana/dashboards/Bamboo.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -223,7 +223,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -410,7 +410,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc",
"rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -511,7 +511,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -649,7 +649,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_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 build_count as \"Build Count\"\nFROM _builds\nORDER BY time\n",
"rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_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 build_count as \"Build Count\"\nFROM _builds\nORDER BY time\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -806,7 +806,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%bamboo%\"\r\n and cicd_scope_id in (${plan_id:sqlstring}+'')\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY\r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Build Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time",
"rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%bamboo%\"\r\n and cicd_scope_id in (${plan_id})\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY\r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Build Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -973,7 +973,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_build_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1",
"rawSql": "SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_build_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1109,7 +1109,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id:sqlstring}+'')\n -- the following condition will remove the month with incomplete data\n and finished_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 mean_duration_sec/60 as mean_duration_minutes\nFROM _builds\nORDER BY time\n",
"rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in (${plan_id})\n -- the following condition will remove the month with incomplete data\n and finished_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 mean_duration_sec/60 as mean_duration_minutes\nFROM _builds\nORDER BY time\n",
"refId": "A",
"select": [
[
Expand Down
18 changes: 9 additions & 9 deletions grafana/dashboards/BitBucket.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select\n\tcount(distinct pr.id) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id:sqlstring}+'')\n\t\n\n",
"rawSql": "select\n\tcount(distinct pr.id) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})\n\t\n\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -292,7 +292,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id:sqlstring}+'')\n and $__timeFilter(created_date)\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 pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n",
"rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in (${repo_id})\n and $__timeFilter(created_date)\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 pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -431,7 +431,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id:sqlstring}+'')\n\tand pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n",
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) 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 = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -563,7 +563,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n count(distinct case when status='CLOSED' then id else null end)/count(distinct case when status in ('MERGED','CLOSED') 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:sqlstring}+'')",
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n count(distinct case when status='CLOSED' then id else null end)/count(distinct case when status in ('MERGED','CLOSED') 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})",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -678,7 +678,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\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 = 'MERGED' then id else null end) as \"PR: Merged\"\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id:sqlstring}+'')\ngroup by 1\n",
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\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 = 'MERGED' 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",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -768,7 +768,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id:sqlstring}+'')\n\tand pr.status = 'CLOSED'",
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(distinct pr.id) 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'",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -903,7 +903,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\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 ('MERGED', 'CLOSED') then id else null end) as ratio\nFROM pull_requests\nWHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id:sqlstring}+'')\ngroup by 1\n",
"rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nSELECT\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 ('MERGED', 'CLOSED') 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",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -992,7 +992,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select\n\tavg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440)\nfrom \n\tpull_requests\nwhere \n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id:sqlstring}+'')\n\tand merged_date is not null\n\n\n",
"rawSql": "select\n\tavg(TIMESTAMPDIFF(Minute,created_date,merged_date)/1440)\nfrom \n\tpull_requests\nwhere \n $__timeFilter(created_date)\n\tand base_repo_id in (${repo_id})\n\tand merged_date is not null\n\n\n",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -1111,7 +1111,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"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,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id:sqlstring}+'')\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_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n",
"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,merged_date)/1440) as time_to_merge\n FROM pull_requests\n WHERE\n $__timeFilter(created_date)\n and base_repo_id in (${repo_id})\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_merge as \"Time to Merge\"\nFROM _prs\nORDER BY time\n",
"refId": "A",
"select": [
[
Expand Down
Loading

0 comments on commit a959768

Please sign in to comment.