This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new ca9b6ee7 feat: add gitextractor dashboard (#3082)
ca9b6ee7 is described below
commit ca9b6ee78df5f9fab72e621f97335aa06dd7a704
Author: xgdyp <[email protected]>
AuthorDate: Mon Sep 19 09:04:41 2022 +0800
feat: add gitextractor dashboard (#3082)
* feat: add gitextractor dashboard
* fix: update gitextractor dashboard
---
grafana/dashboards/GitExtractor.json | 899 +++++++++++++++++++++++++++++++++++
1 file changed, 899 insertions(+)
diff --git a/grafana/dashboards/GitExtractor.json
b/grafana/dashboards/GitExtractor.json
new file mode 100644
index 00000000..e18817f5
--- /dev/null
+++ b/grafana/dashboards/GitExtractor.json
@@ -0,0 +1,899 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "type": "dashboard"
+ }
+ ]
+ },
+ "description": "This dashboard shows the metrics collected by gitextractor
plugin",
+ "editable": true,
+ "gnetId": null,
+ "graphTooltip": 0,
+ "id": 13,
+ "iteration": 1663230599102,
+ "links": [],
+ "panels": [
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 14,
+ "panels": [],
+ "title": "file dimension",
+ "type": "row"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 12,
+ "options": {
+ "barWidth": 0.78,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "rawQuery": true,
+ "rawSql": "SELECT file_path,\n count(distinct author_name)
AS cnt\nFROM commits\nJOIN commit_files\nJOIN repo_commits rc\n ON
commit_files.commit_sha = rc.commit_sha\n AND commit_files.commit_sha =
commits.sha\nWHERE repo_id IN ($repo_id)\n AND
$__timeFilter(commits.authored_date)\n AND file_path REGEXP
'($selected_path)'\nGROUP BY file_path\nORDER BY cnt DESC limit 10;",
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "_raw_data_id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "issue_commits",
+ "timeColumn": "id",
+ "timeColumnType": "bigint",
+ "where": []
+ }
+ ],
+ "title": "files with maximum number of authors",
+ "type": "barchart"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "displayMode": "auto"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 1
+ },
+ "id": 2,
+ "options": {
+ "showHeader": true
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT file_path,\n count(distinct author_name) AS
author_count,\n max(rst) AS file_total_size,max(rst)/count(distinct
author_name) as rate\nFROM commits\nJOIN \n (SELECT file_path,\n
commit_files.commit_sha,\n sum(additions) - sum(deletions) AS rst\n
FROM commit_files\n JOIN repo_commits rc\n ON commit_files.commit_sha
= rc.commit_sha\n WHERE repo_id IN ($repo_id)\n\n GROUP BY
file_path,commit_sha\n ORDER BY r [...]
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "largest files with lowest number of authors",
+ "type": "table"
+ },
+ {
+ "datasource": "mysql",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 9
+ },
+ "id": 10,
+ "options": {
+ "barWidth": 0.8,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT file_path,\n count(*) AS modified_num\nFROM
commits\nJOIN commit_files\nJOIN repo_commits rc\n ON
commit_files.commit_sha = rc.commit_sha\n AND
sha=commit_files.commit_sha\n AND
$__timeFilter(commits.authored_date)\nWHERE repo_id IN ($repo_id) and file_path
REGEXP '($selected_path)'\nAND $__timeFilter(commits.authored_date)\nGROUP BY
file_path\nORDER BY modified_num desc\nLIMIT 15;",
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "files with most modifications",
+ "type": "barchart"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 9
+ },
+ "id": 8,
+ "options": {
+ "barWidth": 0.79,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT file_path,\n count(*) AS cnt\nFROM
commits\nJOIN commit_files\nJOIN repo_commits rc\n ON
commit_files.commit_sha = rc.commit_sha\n AND
sha=commit_files.commit_sha\nWHERE repo_id IN ($repo_id)\n AND
$__timeFilter(commits.authored_date)\nGROUP BY file_path\nORDER BY cnt
desc\nLIMIT 10;",
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "[total]files with most modifications",
+ "type": "barchart"
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 17
+ },
+ "id": 6,
+ "panels": [],
+ "title": "author dimension",
+ "type": "row"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 18
+ },
+ "id": 16,
+ "options": {
+ "barWidth": 0.79,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT author_name,\n count(distinct commit_sha)
AS commit_nums\nFROM commits\nJOIN repo_commits\nWHERE commits.sha
=repo_commits.commit_sha\n AND repo_commits.repo_id IN ($repo_id)\n
AND $__timeFilter(commits.authored_date)\nGROUP BY
author_name,author_id\nORDER BY commit_nums desc\nLIMIT 10; ",
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "commits distribution by author",
+ "type": "barchart"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 79,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 18
+ },
+ "id": 4,
+ "options": {
+ "barWidth": 0.55,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "hide": false,
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT author_name,\n sum(additions-deletions) AS
cnt\nFROM commits\nJOIN repo_commits\nWHERE commits.sha
=repo_commits.commit_sha\n AND repo_commits.repo_id IN ($repo_id)\n
AND $__timeFilter(commits.authored_date)\nGROUP BY
author_name,author_id\nORDER BY cnt DESC \nLIMIT 10;",
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "lines of code distribution by author",
+ "type": "barchart"
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 26
+ },
+ "id": 20,
+ "panels": [],
+ "title": "time perspective",
+ "type": "row"
+ },
+ {
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 27
+ },
+ "id": 22,
+ "options": {
+ "barWidth": 0.97,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "auto",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT\n CASE cast(dayofweek(authored_date) AS char)
\n WHEN '1' THEN\n '1.Monday'\n WHEN '2' THEN\n '2.Tuesday'\n
WHEN '3' THEN\n '3.Wednesday'\n WHEN '4' THEN\n '4.Thursday'\n WHEN
'5' THEN\n '5.Friday'\n WHEN '6' THEN\n '6.Saturday'\n WHEN '7'
THEN\n '7.Sunday'\n END AS weekday , count(distinct commit_sha) AS
commit_nums\nFROM commits\nJOIN repo_commits\nWHERE
$__timeFilter(commits.authored_date)\n AND commits [...]
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "title": "commits distribution",
+ "type": "barchart"
+ },
+ {
+ "cacheTimeout": null,
+ "datasource": "-- Mixed --",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 27
+ },
+ "id": 24,
+ "interval": null,
+ "links": [],
+ "options": {
+ "barWidth": 0.97,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "orientation": "auto",
+ "showValue": "auto",
+ "text": {},
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "pluginVersion": "8.0.6",
+ "targets": [
+ {
+ "datasource": "mysql",
+ "format": "table",
+ "group": [],
+ "metricColumn": "none",
+ "queryType": "randomWalk",
+ "rawQuery": true,
+ "rawSql": "SELECT\n CASE cast(dayofweek(authored_date) AS char)\n
WHEN '1' THEN\n '1.Monday'\n WHEN '2' THEN\n '2.Tuesday'\n WHEN
'3' THEN\n '3.Wednesday'\n WHEN '4' THEN\n '4.Thursday'\n WHEN '5'
THEN\n '5.Friday'\n WHEN '6' THEN\n '6.Saturday'\n WHEN '7' THEN\n
'7.Sunday'\n END AS weekday , sum(additions-deletions) AS changed_nums,
sum(additions) AS total_additions, sum(deletions) AS total_deletions\nFROM
commits\nJOIN repo_comm [...]
+ "refId": "A",
+ "select": [
+ [
+ {
+ "params": [
+ "id"
+ ],
+ "type": "column"
+ }
+ ]
+ ],
+ "table": "_devlake_blueprints",
+ "timeColumn": "created_at",
+ "timeColumnType": "timestamp",
+ "where": [
+ {
+ "name": "$__timeFilter",
+ "params": [],
+ "type": "macro"
+ }
+ ]
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "lines of code distribution",
+ "type": "barchart"
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 35
+ },
+ "id": 26,
+ "panels": [],
+ "title": "component dimension",
+ "type": "row"
+ }
+ ],
+ "refresh": "",
+ "schemaVersion": 30,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {
+ "selected": true,
+ "text": [
+ "hypertrons/hypertrons-crx",
+ "datawhalechina/wonderful-sql"
+ ],
+ "value": [
+ "github:GithubRepo:1:259035151",
+ "github:GithubRepo:1:382057179"
+ ]
+ },
+ "datasource": "mysql",
+ "definition": "select concat(name, '--', id) as text from repos",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": true,
+ "label": "Repo",
+ "multi": true,
+ "name": "repo_id",
+ "options": [],
+ "query": "select concat(name, '--', id) as text from repos",
+ "refresh": 1,
+ "regex": "/^(?<text>.*)--(?<value>.*)$/",
+ "skipUrlSync": false,
+ "sort": 0,
+ "type": "query"
+ },
+ {
+ "current": {
+ "selected": false,
+ "text": "",
+ "value": ""
+ },
+ "description": "input file path",
+ "error": null,
+ "hide": 0,
+ "label": "",
+ "name": "selected_path",
+ "options": [
+ {
+ "selected": true,
+ "text": "",
+ "value": ""
+ }
+ ],
+ "query": "",
+ "skipUrlSync": false,
+ "type": "textbox"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-6M",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ]
+ },
+ "timezone": "",
+ "title": "Gitextractor Metrics Dashboard",
+ "uid": "L4dp9mn4z",
+ "version": 3
+}
\ No newline at end of file