blob: b5faba8349e90cdda9800e554b0e951986908df2 [file] [log] [blame]
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 1,
"iteration": 1637051230516,
"links": [
{
"asDropdown": false,
"icon": "bolt",
"includeVars": false,
"keepTime": true,
"tags": [],
"targetBlank": false,
"title": "Homepage",
"tooltip": "",
"type": "link",
"url": "/grafana/d/RXJZNpMnz/user-value-specific-dashboards-homepage?orgId=1"
},
{
"asDropdown": false,
"icon": "external link",
"includeVars": false,
"keepTime": true,
"tags": [
"user_value"
],
"targetBlank": false,
"title": "metric dashboards",
"tooltip": "",
"type": "dashboards",
"url": ""
}
],
"panels": [
{
"datasource": "mysql",
"description": "1. Number of people who have created or reviewed a Pull/Merge Request.\n2. The PR/MR being calculated are filtered by \"PR/MR creation time\" (time filter at the upper-right corner).",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 0
},
"id": 9,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with all_developers as(\n select \n gitlab_reviewers.name as user_name\n from gitlab_merge_requests\n join gitlab_reviewers on gitlab_reviewers.merge_request_id = gitlab_merge_requests.gitlab_id\n\n WHERE\n $__timeFilter(gitlab_merge_requests.gitlab_created_at)\n and gitlab_merge_requests.project_id = $repo_id\n union\n select \n distinct author_username as user_name \n from gitlab_merge_requests\n WHERE\n $__timeFilter(gitlab_merge_requests.gitlab_created_at)\n and gitlab_merge_requests.project_id = $repo_id\n union\n select \n distinct author_name as user_name \n from gitlab_commits\n WHERE\n $__timeFilter(authored_date)\n and gitlab_commits.project_id = $repo_id\n)\n\n\nSELECT\n now() AS \"time\",\n count(distinct user_name) as developer_count\nFROM all_developers",
"refId": "A",
"select": [
[
{
"params": [
"progress"
],
"type": "column"
}
]
],
"table": "ca_analysis",
"timeColumn": "create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Total Developer Count",
"type": "stat"
},
{
"datasource": "mysql",
"description": "1. Total number of Commit Authors.\n2. The commits being calculated are filtered by \"authored_date\" (time filter at the upper-right corner).",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 0,
"y": 6
},
"id": 13,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n now() AS time,\n count(distinct author_name) as value\nFROM gitlab_commits\nWHERE\n $__timeFilter(authored_date)\n and project_id = $repo_id\ngroup by 1\nORDER BY 1",
"refId": "A",
"select": [
[
{
"params": [
"progress"
],
"type": "column"
}
]
],
"table": "ca_analysis",
"timeColumn": "create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Commit Author Count",
"type": "stat"
},
{
"datasource": "mysql",
"description": "1. Number of Pull/Merge Request Reviewers.\n2. The PR/MR being calculated are filtered by \"PR/MR creation time\" (time filter at the upper-right corner).",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 8,
"y": 6
},
"id": 8,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "select \n now() as time,\n count(distinct name)\nfrom\n gitlab_reviewers",
"refId": "A",
"select": [
[
{
"params": [
"progress"
],
"type": "column"
}
]
],
"table": "ca_analysis",
"timeColumn": "create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Pull Request Reviewer Count",
"type": "stat"
},
{
"datasource": "mysql",
"description": "Pull Request Reviewer Count/Total Developer Count",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 0.2
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 16,
"y": 6
},
"id": 16,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "with all_user_names as(\n select \n distinct gitlab_reviewers.name as user_name\n from gitlab_reviewers\n join gitlab_merge_requests on gitlab_reviewers.merge_request_id = gitlab_merge_requests.gitlab_id\n WHERE\n $__timeFilter(gitlab_merge_requests.gitlab_created_at)\n and gitlab_reviewers.project_id = $repo_id\n union\n select \n distinct author_username as user_name \n from gitlab_merge_requests\n WHERE\n $__timeFilter(gitlab_created_at)\n and project_id = $repo_id\n union\n select \n distinct author_name as user_name \n from gitlab_commits\n WHERE\n $__timeFilter(authored_date)\n and project_id = $repo_id\n),\n\nreviewer as (\n select distinct gitlab_reviewers.name from gitlab_reviewers\n join gitlab_merge_requests on gitlab_reviewers.merge_request_id = gitlab_merge_requests.gitlab_id\nWHERE\n $__timeFilter(gitlab_merge_requests.gitlab_created_at)\n and gitlab_reviewers.project_id = $repo_id\n)\n\nSELECT\n now() AS \"time\",\n 1.0*count(distinct reviewer.name)/count(distinct user_name) as value\nFROM reviewer, all_user_names",
"refId": "A",
"select": [
[
{
"params": [
"progress"
],
"type": "column"
}
]
],
"table": "ca_analysis",
"timeColumn": "create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Pull Request Reviewer Rate (%)",
"type": "stat"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [
"cost",
"user_value"
],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": "mysql",
"definition": "select distinct concat(name, ': ', gitlab_id) from gitlab_projects",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": "Choose Repo",
"multi": false,
"name": "repo_id",
"options": [],
"query": "select distinct concat(name, ': ', gitlab_id) from gitlab_projects",
"refresh": 1,
"regex": "/^(?<text>[^:]+): (?<value>\\d+)$/",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6M",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Delivery Cost (require Gitlab data)",
"uid": "TV-BnpM7k",
"version": 7
}