From aed160ceb75ac9fb3b8cdb3062da260d9ac75531 Mon Sep 17 00:00:00 2001 From: Lorain Date: Fri, 28 Jun 2024 18:39:33 +0800 Subject: [PATCH] feat: add contributor, repo, org, group dynamic tmpl --- DEPLOY.md | 0 README.md | 19 - TODO.md | 8 + template/OPENALYSIS-CONTRIBUTOR-TMPL.json | 197 +- template/OPENALYSIS-GROUP-TMPL.json | 1752 +++++++++++++++ template/OPENALYSIS-ORG-TMPL.json | 2455 +++++++++++++++++++++ template/OPENALYSIS-REPO-TMPL.json | 1772 +++++++++++++++ 7 files changed, 6164 insertions(+), 39 deletions(-) create mode 100644 DEPLOY.md create mode 100644 TODO.md create mode 100644 template/OPENALYSIS-GROUP-TMPL.json create mode 100644 template/OPENALYSIS-ORG-TMPL.json create mode 100644 template/OPENALYSIS-REPO-TMPL.json diff --git a/DEPLOY.md b/DEPLOY.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 8d29cf9..4646fe4 100644 --- a/README.md +++ b/README.md @@ -191,25 +191,6 @@ docker run -it -v path2config.yaml:/src openalysis start path2config.yaml - [How to Visualize and Analyze Data in Open Source Communities](https://dev.to/justlorain/how-to-visualize-and-analyze-data-in-open-source-communities-1l35) | [δΈ­ζ–‡](https://juejin.cn/post/7359882185362948135) -## TODO - -- [x] support for marking contributor company manually -- [x] org, group time series support -- [x] issue, pr number => issue, pr id -- [ ] leaderboard, issue, pr adapt to time range - ---- - -- [ ] provide group, org, repo, contributor four level of dashboards (use dashboard link to jump between different dashboards, use dashboard variables to customize data display in one of the four levels dashboards) -- [ ] optimize contribution statistics (calculate in pre-analysis) -- [ ] parse json to adapt general template -- [ ] cmd tool optimize -- [ ] optimize logger -- [ ] provide more api -- [ ] pre-analyse -- [ ] optimize error handling -- [ ] OLAP storage - ## Acknowledgement Sincere appreciation to the [CloudWeGo](https://github.com/cloudwego) community, without whose help this project would not have been possible. diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..b16b908 --- /dev/null +++ b/TODO.md @@ -0,0 +1,8 @@ +- [ ] code logic simplify +- [ ] parse json to adapt general template +- [ ] cmd tool optimize +- [ ] optimize logger +- [ ] provide more api +- [ ] pre-analyse +- [ ] optimize error handling +- [ ] OLAP storage diff --git a/template/OPENALYSIS-CONTRIBUTOR-TMPL.json b/template/OPENALYSIS-CONTRIBUTOR-TMPL.json index 8fa7636..84da57c 100644 --- a/template/OPENALYSIS-CONTRIBUTOR-TMPL.json +++ b/template/OPENALYSIS-CONTRIBUTOR-TMPL.json @@ -114,7 +114,7 @@ "uid": "${DS_OPENALYSIS-MYSQL}" }, "gridPos": { - "h": 9, + "h": 10, "w": 4, "x": 0, "y": 0 @@ -126,7 +126,7 @@ "showLineNumbers": false, "showMiniMap": false }, - "content": "\"avatar\"\n\n---\n\n- 🏒 **Company**: ${company}\n- 🏑 **Location**: ${location}\n", + "content": "\"avatar\"\n\n---\n\n- 🏒 **Company**: ${company}\n- 🏑 **Location**: ${location}\n- 🀝 **1st Contribution**: ${first_contribution} \n- πŸ”₯ **Total Contributions**: ${total_contributions}\n", "mode": "markdown" }, "pluginVersion": "10.3.3", @@ -198,7 +198,7 @@ "overrides": [] }, "gridPos": { - "h": 9, + "h": 10, "w": 11, "x": 4, "y": 0 @@ -332,7 +332,7 @@ ] }, "gridPos": { - "h": 9, + "h": 10, "w": 9, "x": 15, "y": 0 @@ -352,7 +352,12 @@ "show": true }, "showHeader": true, - "sortBy": [] + "sortBy": [ + { + "desc": true, + "displayName": "Contributions" + } + ] }, "pluginVersion": "10.3.3", "targets": [ @@ -427,7 +432,7 @@ "h": 9, "w": 12, "x": 0, - "y": 9 + "y": 10 }, "id": 2, "options": { @@ -555,7 +560,7 @@ "h": 9, "w": 12, "x": 12, - "y": 9 + "y": 10 }, "id": 3, "options": { @@ -681,7 +686,7 @@ { "matcher": { "id": "byName", - "options": "Count" + "options": "Total Count" }, "properties": [ { @@ -697,6 +702,49 @@ } } ] + }, + { + "matcher": { + "id": "byName", + "options": "Open Count" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge" + } + }, + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Closed Count" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] } ] }, @@ -704,7 +752,7 @@ "h": 9, "w": 12, "x": 0, - "y": 18 + "y": 19 }, "id": 4, "options": { @@ -713,7 +761,9 @@ "countRows": false, "enablePagination": true, "fields": [ - "Count" + "Total Count", + "Open Count", + "Closed Count" ], "reducer": [ "sum" @@ -724,7 +774,7 @@ "sortBy": [ { "desc": true, - "displayName": "Count" + "displayName": "Total Count" } ] }, @@ -739,7 +789,7 @@ "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT\r\n CONCAT(repo_owner, '/', repo_name) AS Repo,\r\n COUNT(*) AS Count\r\nFROM\r\n issues\r\nWHERE\r\n author = '$login'\r\nGROUP BY\r\n repo_node_id;", + "rawSql": "SELECT\r\n CONCAT(repo_owner, '/', repo_name) AS Repo,\r\n COUNT(*) AS `Total Count`,\r\n SUM(IF(state = 'OPEN', 1, 0)) AS `Open Count`,\r\n SUM(IF(state = 'CLOSED', 1, 0)) AS `Closed Count`\r\nFROM\r\n issues\r\nWHERE\r\n author = '$login'\r\nGROUP BY\r\n repo_node_id;", "refId": "A", "sql": { "columns": [ @@ -799,7 +849,7 @@ { "matcher": { "id": "byName", - "options": "Count" + "options": "Total Count" }, "properties": [ { @@ -817,6 +867,72 @@ } } ] + }, + { + "matcher": { + "id": "byName", + "options": "Open Count" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Merged Count" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Closed Count" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] } ] }, @@ -824,7 +940,7 @@ "h": 9, "w": 12, "x": 12, - "y": 18 + "y": 19 }, "id": 5, "options": { @@ -833,7 +949,10 @@ "countRows": false, "enablePagination": true, "fields": [ - "Count" + "Total Count", + "Open Count", + "Merged Count", + "Closed Count" ], "reducer": [ "sum" @@ -844,7 +963,7 @@ "sortBy": [ { "desc": true, - "displayName": "Count" + "displayName": "Total Count" } ] }, @@ -859,7 +978,7 @@ "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT\r\n CONCAT(repo_owner, '/', repo_name) AS Repo,\r\n COUNT(*) AS Count\r\nFROM\r\n pull_requests\r\nWHERE\r\n author = '$login'\r\nGROUP BY\r\n repo_node_id;", + "rawSql": "SELECT\r\n CONCAT(repo_owner, '/', repo_name) AS Repo,\r\n COUNT(*) AS `Total Count`,\r\n SUM(IF(state = 'OPEN', 1, 0)) AS `Open Count`,\r\n SUM(IF(state = 'MERGED', 1, 0)) AS `Merged Count`,\r\n SUM(IF(state = 'CLOSED', 1, 0)) AS `Closed Count`\r\nFROM\r\n pull_requests\r\nWHERE\r\n author = '$login'\r\nGROUP BY\r\n repo_node_id;", "refId": "A", "sql": { "columns": [ @@ -971,17 +1090,55 @@ "skipUrlSync": false, "sort": 0, "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT DATE_FORMAT(pr_merged_at, '%Y-%m-%d') AS `First Commit`\nFROM pull_requests\nWHERE author = '$login' AND state = 'MERGED'\nORDER BY pr_merged_at ASC\nLIMIT 1;", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "first_contribution", + "options": [], + "query": "SELECT DATE_FORMAT(pr_merged_at, '%Y-%m-%d') AS `First Commit`\nFROM pull_requests\nWHERE author = '$login' AND state = 'MERGED'\nORDER BY pr_merged_at ASC\nLIMIT 1;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT SUM(c.contributions) as `TotalContributions`\nFROM openalysis.contributors c\nINNER JOIN (\n SELECT repo_node_id, MAX(created_at) as MaxDate\n FROM contributors\n WHERE Login = '$login'\n GROUP BY repo_node_id\n) latest_contributions\nON c.repo_node_id = latest_contributions.repo_node_id AND c.created_at = latest_contributions.MaxDate\nWHERE c.login = '$login';", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "total_contributions", + "options": [], + "query": "SELECT SUM(c.contributions) as `TotalContributions`\nFROM openalysis.contributors c\nINNER JOIN (\n SELECT repo_node_id, MAX(created_at) as MaxDate\n FROM contributors\n WHERE Login = '$login'\n GROUP BY repo_node_id\n) latest_contributions\nON c.repo_node_id = latest_contributions.repo_node_id AND c.created_at = latest_contributions.MaxDate\nWHERE c.login = '$login';", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" } ] }, "time": { - "from": "2021-07-15T14:35:24.000Z", - "to": "2024-06-24T19:28:20.000Z" + "from": "2022-01-16T18:53:12.000Z", + "to": "2024-06-03T15:44:35.000Z" }, "timepicker": {}, "timezone": "", "title": "OPENALYSIS-CONTRIBUTOR-TMPL", "uid": "ba57340a-480f-45a8-8c50-ee0df5ec732e", - "version": 9, + "version": 14, "weekStart": "" } \ No newline at end of file diff --git a/template/OPENALYSIS-GROUP-TMPL.json b/template/OPENALYSIS-GROUP-TMPL.json new file mode 100644 index 0000000..fb8c9b5 --- /dev/null +++ b/template/OPENALYSIS-GROUP-TMPL.json @@ -0,0 +1,1752 @@ +{ + "__inputs": [ + { + "name": "DS_OPENALYSIS-MYSQL", + "label": "openalysis-mysql", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "MySQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.3" + }, + { + "type": "datasource", + "id": "mysql", + "name": "MySQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "org" + ], + "targetBlank": true, + "title": "Org Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "repo" + ], + "targetBlank": true, + "title": "Repo Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "contributor" + ], + "targetBlank": true, + "title": "Contributor Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 8, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 10, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 0 + }, + "id": 12, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 0 + }, + "id": 13, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 0 + }, + "id": 11, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 14, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 15, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 8 + }, + "id": 17, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 8 + }, + "id": 18, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 8 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.`groups`\r\nWHERE name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 0, + "y": 16 + }, + "id": 2, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, company, 'Others') AS Company,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n company,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n company\r\n FROM\r\n contributors\r\n WHERE\r\n repo_name IN (SELECT r.name\r\nFROM repositories r\r\nJOIN groups_repositories gr ON r.node_id = gr.repo_node_id\r\nWHERE gr.group_name = '$name'\r\nUNION\r\nSELECT r.name\r\nFROM repositories r\r\nJOIN groups_organizations go ON r.owner_node_id = go.org_node_id\r\nWHERE go.group_name = '$name'\r\n) AND company <> '' AND company IS NOT NULL\r\n GROUP BY\r\n node_id, company\r\n ) AS unique_contributors\r\n GROUP BY\r\n company\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, company, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Company", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 7, + "y": 16 + }, + "id": 3, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, location, 'Others') AS `Location`,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n location,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n location\r\n FROM\r\n contributors\r\n WHERE\r\n repo_name IN (SELECT r.name\r\nFROM repositories r\r\nJOIN groups_repositories gr ON r.node_id = gr.repo_node_id\r\nWHERE gr.group_name = '$name'\r\nUNION\r\nSELECT r.name\r\nFROM repositories r\r\nJOIN groups_organizations go ON r.owner_node_id = go.org_node_id\r\nWHERE go.group_name = '$name'\r\n) AND location <> '' AND location IS NOT NULL\r\n GROUP BY\r\n node_id, location\r\n ) AS unique_contributors\r\n GROUP BY\r\n location\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, location, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Location", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "color-text" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Ranged Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 10, + "x": 14, + "y": 16 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Total Contributions" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "WITH first_contributions AS (\r\n SELECT\r\n login,\r\n group_name,\r\n MIN(created_at) AS first_contribution_date\r\n FROM\r\n openalysis.analyzed_group_contributions\r\n WHERE\r\n group_name = '$name'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, group_name\r\n),\r\nlast_contributions AS (\r\n SELECT\r\n login,\r\n group_name,\r\n MAX(created_at) AS last_contribution_date\r\n FROM\r\n openalysis.analyzed_group_contributions\r\n WHERE\r\n group_name = '$name'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, group_name\r\n),\r\nfirst_contributions_details AS (\r\n SELECT\r\n fc.login,\r\n fc.group_name,\r\n c.contributions AS first_contributions\r\n FROM\r\n first_contributions fc\r\n JOIN\r\n openalysis.analyzed_group_contributions c\r\n ON\r\n fc.login = c.login\r\n AND fc.group_name = c.group_name\r\n AND fc.first_contribution_date = c.created_at\r\n),\r\nlast_contributions_details AS (\r\n SELECT\r\n lc.login,\r\n lc.group_name,\r\n c.contributions AS last_contributions,\r\n c.created_at AS last_contribution_date\r\n FROM\r\n last_contributions lc\r\n JOIN\r\n openalysis.analyzed_group_contributions c\r\n ON\r\n lc.login = c.login\r\n AND lc.group_name = c.group_name\r\n AND lc.last_contribution_date = c.created_at\r\n)\r\nSELECT\r\n fcd.login AS `Login`,\r\n (lcd.last_contributions - fcd.first_contributions) AS `Ranged Contributions`,\r\n lcd.last_contributions AS `Total Contributions`\r\nFROM\r\n first_contributions_details fcd\r\nJOIN\r\n last_contributions_details lcd\r\nON\r\n fcd.login = lcd.login\r\n AND fcd.group_name = lcd.group_name\r\nORDER BY\r\n `Ranged Contributions` DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "contributions", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Leaderboard", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 5, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Issue Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n issue_repo_name as `Repo`,\r\n issue_url as `Issue URL`,\r\n issue_number as `Issue ID`\r\nFROM\r\n openalysis.issue_assignees\r\nWHERE\r\n SUBSTRING_INDEX(issue_repo_name, '/', -1) IN (SELECT r.name\r\nFROM repositories r\r\nJOIN groups_repositories gr ON r.node_id = gr.repo_node_id\r\nWHERE gr.group_name = '$name'\r\nUNION\r\nSELECT r.name\r\nFROM repositories r\r\nJOIN groups_organizations go ON r.owner_node_id = go.org_node_id\r\nWHERE go.group_name = '$name');", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "Issue Assignees", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 6, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Issue Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n pull_request_repo_name as `Repo`,\r\n pull_request_url as `Issue URL`,\r\n pull_request_number as `Issue ID`\r\nFROM\r\n openalysis.pull_request_assignees\r\nWHERE\r\n SUBSTRING_INDEX(pull_request_repo_name, '/', -1) IN (SELECT r.name\r\nFROM repositories r\r\nJOIN groups_repositories gr ON r.node_id = gr.repo_node_id\r\nWHERE gr.group_name = '$name'\r\nUNION\r\nSELECT r.name\r\nFROM repositories r\r\nJOIN groups_organizations go ON r.owner_node_id = go.org_node_id\r\nWHERE go.group_name = '$name');", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "PR Assignees", + "type": "table" + } + ], + "refresh": false, + "schemaVersion": 39, + "tags": [ + "group" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT name FROM openalysis.`groups` g GROUP BY g.name;", + "description": "group name", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "name", + "options": [], + "query": "SELECT name FROM openalysis.`groups` g GROUP BY g.name;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-2d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OPENALYSIS-GROUP-TMPL", + "uid": "b6afa6f5-38b8-4e3d-ac1c-fa1ab719c7ac", + "version": 16, + "weekStart": "" +} \ No newline at end of file diff --git a/template/OPENALYSIS-ORG-TMPL.json b/template/OPENALYSIS-ORG-TMPL.json new file mode 100644 index 0000000..5b078a8 --- /dev/null +++ b/template/OPENALYSIS-ORG-TMPL.json @@ -0,0 +1,2455 @@ +{ + "__inputs": [ + { + "name": "DS_OPENALYSIS-MYSQL", + "label": "openalysis-mysql", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "MySQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.3" + }, + { + "type": "datasource", + "id": "mysql", + "name": "MySQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "group" + ], + "targetBlank": true, + "title": "Group Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "repo" + ], + "targetBlank": true, + "title": "Repo Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "contributor" + ], + "targetBlank": true, + "title": "Contributor Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 10, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "\"avatar\"", + "mode": "markdown" + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "builder", + "format": "table", + "rawSql": "", + "refId": "A" + } + ], + "title": "Profile", + "type": "text" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 4, + "y": 0 + }, + "id": 12, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, company, 'Others') AS Company,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n company,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n company\r\n FROM\r\n contributors\r\n WHERE\r\n repo_name IN ($repos) AND company <> '' AND company IS NOT NULL\r\n GROUP BY\r\n node_id, company\r\n ) AS unique_contributors\r\n GROUP BY\r\n company\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, company, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Company (support repos)", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 10, + "y": 0 + }, + "id": 3, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, location, 'Others') AS Location,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n location,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n location\r\n FROM\r\n openalysis.contributors\r\n WHERE\r\n repo_name IN ($repos) AND location <> '' AND location IS NOT NULL\r\n GROUP BY\r\n node_id, location\r\n ) AS unique_contributors\r\n GROUP BY\r\n location\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, location, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Location (support repos)", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "color-text" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Ranged Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Total Contributions" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "WITH first_contributions AS (\r\n SELECT\r\n login,\r\n org_login,\r\n MIN(created_at) AS first_contribution_date\r\n FROM\r\n openalysis.analyzed_org_contributions\r\n WHERE\r\n org_login = '$login'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, org_login\r\n),\r\nlast_contributions AS (\r\n SELECT\r\n login,\r\n org_login,\r\n MAX(created_at) AS last_contribution_date\r\n FROM\r\n openalysis.analyzed_org_contributions\r\n WHERE\r\n org_login = '$login'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, org_login\r\n),\r\nfirst_contributions_details AS (\r\n SELECT\r\n fc.login,\r\n fc.org_login,\r\n c.contributions AS first_contributions\r\n FROM\r\n first_contributions fc\r\n JOIN\r\n openalysis.analyzed_org_contributions c\r\n ON\r\n fc.login = c.login\r\n AND fc.org_login = c.org_login\r\n AND fc.first_contribution_date = c.created_at\r\n),\r\nlast_contributions_details AS (\r\n SELECT\r\n lc.login,\r\n lc.org_login,\r\n c.contributions AS last_contributions\r\n FROM\r\n last_contributions lc\r\n JOIN\r\n openalysis.analyzed_org_contributions c\r\n ON\r\n lc.login = c.login\r\n AND lc.org_login = c.org_login\r\n AND lc.last_contribution_date = c.created_at\r\n)\r\nSELECT\r\n fcd.login AS `Login`,\r\n (lcd.last_contributions - fcd.first_contributions) AS `Ranged Contributions`,\r\n lcd.last_contributions AS `Total Contributions`\r\nFROM\r\n first_contributions_details fcd\r\nJOIN\r\n last_contributions_details lcd\r\nON\r\n fcd.login = lcd.login\r\n AND fcd.org_login = lcd.org_login\r\nORDER BY\r\n `Ranged Contributions` DESC;\r\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "contributions", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Leaderboard", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 5, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 9, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 8 + }, + "id": 7, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 8 + }, + "id": 8, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 8 + }, + "id": 6, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 16 + }, + "id": 20, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 16 + }, + "id": 24, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 16 + }, + "id": 22, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 16 + }, + "id": 23, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 16 + }, + "id": 21, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.organizations\r\nWHERE login = '$login';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 15, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Issue Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n SUBSTRING_INDEX(issue_repo_name, '/', -1) as `Repo`,\r\n issue_url as `Issue URL`,\r\n issue_number as `Issue ID`\r\nFROM\r\n openalysis.issue_assignees\r\nWHERE\r\n SUBSTRING_INDEX(issue_repo_name, '/', -1) IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "Issue Assignees (support repos)", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 14, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Issue Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n SUBSTRING_INDEX(pull_request_repo_name, '/', -1) as `Repo`,\r\n pull_request_url as `Issue URL`,\r\n pull_request_number as `Issue ID`\r\nFROM\r\n openalysis.pull_request_assignees\r\nWHERE\r\n SUBSTRING_INDEX(pull_request_repo_name, '/', -1) IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "PR Assignees (support repos)", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "gorm", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n name AS `Repo`,\r\n star_count AS `Count`,\r\n created_at AS `Created At`\r\nFROM openalysis.repositories\r\nWHERE name IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count (support repos)", + "transformations": [ + { + "id": "prepareTimeSeries", + "options": { + "format": "multi" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "gorm", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n name AS `Repo`,\r\n contributor_count AS `Count`,\r\n created_at AS `Created At`\r\nFROM openalysis.repositories\r\nWHERE name IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count (support repos)", + "transformations": [ + { + "id": "prepareTimeSeries", + "options": { + "format": "multi" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 40 + }, + "id": 17, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "gorm", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n name AS `Repo`,\r\n fork_count AS `Count`,\r\n created_at AS `Created At`\r\nFROM openalysis.repositories\r\nWHERE name IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count (support repos)", + "transformations": [ + { + "id": "prepareTimeSeries", + "options": { + "format": "multi" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 40 + }, + "id": 18, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "gorm", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n name AS `Repo`,\r\n issue_count AS `Count`,\r\n created_at AS `Created At`\r\nFROM openalysis.repositories\r\nWHERE name IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count (support repos)", + "transformations": [ + { + "id": "prepareTimeSeries", + "options": { + "format": "multi" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 40 + }, + "id": 19, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "gorm", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n name AS `Repo`,\r\n pull_request_count AS `Count`,\r\n created_at AS `Created At`\r\nFROM openalysis.repositories\r\nWHERE name IN ($repos);", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count (support repos)", + "transformations": [ + { + "id": "prepareTimeSeries", + "options": { + "format": "multi" + } + } + ], + "type": "timeseries" + } + ], + "refresh": false, + "schemaVersion": 39, + "tags": [ + "org" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT login FROM openalysis.organizations o GROUP BY o.node_id;", + "description": "organization login", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "login", + "options": [], + "query": "SELECT login FROM openalysis.organizations o GROUP BY o.node_id;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT DISTINCT avatar_url FROM openalysis.organizations WHERE login = '$login';", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "avatar_url", + "options": [], + "query": "SELECT DISTINCT avatar_url FROM openalysis.organizations WHERE login = '$login';", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT DISTINCT name FROM openalysis.repositories WHERE owner = '$login';", + "description": "selected repo names", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "repos", + "options": [], + "query": "SELECT DISTINCT name FROM openalysis.repositories WHERE owner = '$login';", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-2d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OPENALYSIS-ORG-TMPL", + "uid": "e3d174cc-7ec4-46bf-a24c-e7548c3c5d30", + "version": 22, + "weekStart": "" +} \ No newline at end of file diff --git a/template/OPENALYSIS-REPO-TMPL.json b/template/OPENALYSIS-REPO-TMPL.json new file mode 100644 index 0000000..b9883ef --- /dev/null +++ b/template/OPENALYSIS-REPO-TMPL.json @@ -0,0 +1,1772 @@ +{ + "__inputs": [ + { + "name": "DS_OPENALYSIS-MYSQL", + "label": "openalysis-mysql", + "description": "", + "type": "datasource", + "pluginId": "mysql", + "pluginName": "MySQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.3.3" + }, + { + "type": "datasource", + "id": "mysql", + "name": "MySQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "group" + ], + "targetBlank": true, + "title": "Group Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "org" + ], + "targetBlank": true, + "title": "Org Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "contributor" + ], + "targetBlank": true, + "title": "Contributor Dashboard", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 0, + "y": 0 + }, + "id": 14, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, company, 'Others') AS Company,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n company,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n company\r\n FROM\r\n contributors\r\n WHERE\r\n repo_owner = '$owner' AND repo_name = '$name' AND company <> '' AND company IS NOT NULL\r\n GROUP BY\r\n node_id, company\r\n ) AS unique_contributors\r\n GROUP BY\r\n company\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, company, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Company", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 7, + "y": 0 + }, + "id": 13, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n IF(`rank` <= 10, location, 'Others') AS Location,\r\n SUM(occurrences) AS Count\r\nFROM (\r\n SELECT\r\n location,\r\n ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS `rank`,\r\n COUNT(*) AS occurrences\r\n FROM (\r\n SELECT\r\n node_id,\r\n location\r\n FROM\r\n openalysis.contributors\r\n WHERE\r\n repo_owner = '$owner' AND repo_name = '$name' AND location <> '' AND location IS NOT NULL\r\n GROUP BY\r\n node_id, location\r\n ) AS unique_contributors\r\n GROUP BY\r\n location\r\n) AS ranked_locations\r\nGROUP BY\r\n IF(`rank` <= 10, location, 'Others')\r\nORDER BY\r\n SUM(occurrences) DESC;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "location", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Contributor Location", + "type": "piechart" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "color-text" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Ranged Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge", + "valueDisplayMode": "text" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Contributions" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "gauge" + } + }, + { + "id": "color", + "value": { + "mode": "continuous-BlYlRd" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 10, + "x": 14, + "y": 0 + }, + "id": 15, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Total Contributions" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "WITH first_contributions AS (\r\n SELECT\r\n login,\r\n repo_name,\r\n MIN(created_at) AS first_contribution_date\r\n FROM\r\n contributors\r\n WHERE\r\n repo_owner = '$owner'\r\n AND repo_name = '$name'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, repo_name\r\n),\r\nlast_contributions AS (\r\n SELECT\r\n login,\r\n repo_name,\r\n MAX(created_at) AS last_contribution_date\r\n FROM\r\n contributors\r\n WHERE\r\n repo_owner = '$owner'\r\n AND repo_name = '$name'\r\n AND created_at >= $__timeFrom()\r\n AND created_at <= $__timeTo()\r\n GROUP BY\r\n login, repo_name\r\n),\r\nfirst_contributions_details AS (\r\n SELECT\r\n fc.login,\r\n fc.repo_name,\r\n c.contributions AS first_contributions\r\n FROM\r\n first_contributions fc\r\n JOIN\r\n contributors c\r\n ON\r\n fc.login = c.login\r\n AND fc.repo_name = c.repo_name\r\n AND fc.first_contribution_date = c.created_at\r\n),\r\nlast_contributions_details AS (\r\n SELECT\r\n lc.login,\r\n lc.repo_name,\r\n c.contributions AS last_contributions\r\n FROM\r\n last_contributions lc\r\n JOIN\r\n contributors c\r\n ON\r\n lc.login = c.login\r\n AND lc.repo_name = c.repo_name\r\n AND lc.last_contribution_date = c.created_at\r\n)\r\nSELECT\r\n fcd.login AS `Login`,\r\n (lcd.last_contributions - fcd.first_contributions) AS `Ranged Contributions`,\r\n lcd.last_contributions AS `Total Contributions`\r\nFROM\r\n first_contributions_details fcd\r\nJOIN\r\n last_contributions_details lcd\r\nON\r\n fcd.login = lcd.login\r\n AND fcd.repo_name = lcd.repo_name\r\nORDER BY\r\n `Ranged Contributions` DESC;\r\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "contributions", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "contributors" + } + ], + "title": "Leaderboard", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 9, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 8 + }, + "id": 8, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 8 + }, + "id": 18, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 8 + }, + "id": 7, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 16 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n star_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Star Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 16 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n contributor_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Contributor Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 12, + "y": 16 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n issue_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Issue Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 16, + "y": 16 + }, + "id": 19, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n pull_request_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "PR Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "orange", + "value": null + } + ] + }, + "unit": "none", + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 20, + "y": 16 + }, + "id": 10, + "options": { + "legend": { + "calcs": [ + "max", + "min", + "range" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "dataset": "mysql", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "SELECT\r\n fork_count as `Count`,\r\n created_at as `Created At`\r\nFROM openalysis.repositories\r\nWHERE owner = '$owner' AND name = '$name';", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Fork Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 16, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Issue Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n issue_url as `Issue URL`,\r\n issue_number as `Issue ID`\r\nFROM\r\n openalysis.issue_assignees\r\nWHERE\r\n issue_repo_name = CONCAT('$owner', '/', '$name');", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "Issue Assignees", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "align": "left", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unitScale": true + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "id": 17, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "PR Number" + } + ] + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "dataset": "openalysis", + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\r\n assignee_login as `Assignee`,\r\n pull_request_url as `PR URL`,\r\n pull_request_number as `PR ID`\r\nFROM\r\n openalysis.pull_request_assignees\r\nWHERE\r\n pull_request_repo_name = CONCAT('$owner', '/', '$name');", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [ + { + "name": "assignee_login", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_number", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "issue_url", + "type": "functionParameter" + } + ], + "type": "function" + }, + { + "parameters": [ + { + "name": "created_at", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "issue_assignees" + } + ], + "title": "PR Assignees", + "type": "table" + } + ], + "refresh": false, + "schemaVersion": 39, + "tags": [ + "repo" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT owner FROM openalysis.repositories r group by r.owner;", + "description": "repository owner", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "owner", + "options": [], + "query": "SELECT owner FROM openalysis.repositories r group by r.owner;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "mysql", + "uid": "${DS_OPENALYSIS-MYSQL}" + }, + "definition": "SELECT name FROM openalysis.repositories r WHERE owner = '$owner';", + "description": "repository name", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "name", + "options": [], + "query": "SELECT name FROM openalysis.repositories r WHERE owner = '$owner';", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-2d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OPENALYSIS-REPO-TMPL", + "uid": "efeda89d-5dbb-4138-84d9-09754f03c0cb", + "version": 17, + "weekStart": "" +} \ No newline at end of file