blob: 3f17d0143df246bc8377ae6bba167530a0472572 [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,
"links": [
{
"asDropdown": false,
"icon": "bolt",
"includeVars": false,
"keepTime": true,
"tags": [],
"targetBlank": false,
"title": "Homepage",
"tooltip": "",
"type": "link",
"url": "/grafana/d/0Rjxknc7z/demo-homepage?orgId=1"
},
{
"asDropdown": false,
"icon": "external link",
"includeVars": false,
"keepTime": false,
"tags": [],
"targetBlank": false,
"title": "Back to previous page",
"tooltip": "",
"type": "link",
"url": "/grafana/d/SupYz7c7z/demo-how-fast-do-we-respond-to-customer-requirements?orgId=1"
}
],
"panels": [
{
"datasource": "mysql",
"description": "1. Compare the average time spent in each state of a requirement in the last 2 months.\n2. The requirements being calculated are the requirements delivered in the last 2 months.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "Days",
"axisPlacement": "auto",
"axisSoftMax": 8,
"axisSoftMin": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 0
},
"id": 98,
"options": {
"barWidth": 0.6,
"groupWidth": 0.5,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "vertical",
"showValue": "always",
"text": {
"valueSize": 16
},
"tooltip": {
"mode": "multi"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "with _requirements as(\n select \n DATE_ADD(date(resolution_date), INTERVAL -DAY(date(resolution_date))+1 DAY) as time,\n assignee_name as assignee,\n avg(lead_time_minutes)/1440 as lead_time\n from issues i\n where \n type = 'REQUIREMENT'\n and assignee_id != ''\n and $__timeFilter(resolution_date)\n group by 1,2\n),\n\n\nthis_month as(\n\tselect \n\t\tDATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY) as this_month\n),\n\nlast_month as(\n\tSELECT \n\t\tDATE_ADD(DATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY), INTERVAL -1 MONTH) as last_month\n),\n\nthe_month_before_last as(\n\tSELECT \n\t\tDATE_ADD(DATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY), INTERVAL -2 MONTH) as the_month_before_last\n),\n\nthis_month_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as this_month_count,\n\t\ttime as this_month\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT this_month from this_month)\n),\n\nlast_month_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as last_month_count,\n\t\ttime as last_month\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT last_month from last_month)\n),\n\nthe_month_before_last_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as the_month_before_last_count,\n\t\ttime as the_month_before_last\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT the_month_before_last from the_month_before_last)\n)\n\nSELECT\n COALESCE(NULLIF(tmr.assignee,''), NULLIF(lmr.assignee,''), tmblr.assignee) AS 'Assignee',\n\tCOALESCE(tmblr.the_month_before_last_count,0) AS \"The Month before Last\",\n\tCOALESCE(lmr.last_month_count,0) AS \"Last Month\",\n\tCOALESCE(tmr.this_month_count,0) AS \"This Month\",\n\tcase \n\t when lmr.last_month_count is null or tmr.this_month_count is null then '-'\n\t else concat(FORMAT(100 * (tmr.this_month_count - lmr.last_month_count)/lmr.last_month_count,1),'%') end as \"Changes in last 2 month\"\nFrom the_month_before_last_record tmblr \n left join last_month_record lmr on tmblr.assignee = lmr.assignee\n left join this_month_record tmr on tmblr.assignee = tmr.assignee\norder by 2",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Average Requirement Lead Time by Assignee (day)",
"type": "barchart"
},
{
"datasource": "mysql",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 8
},
"id": 100,
"options": {
"showHeader": true
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"queryType": "randomWalk",
"rawQuery": true,
"rawSql": "with _requirements as(\n select \n DATE_ADD(date(resolution_date), INTERVAL -DAY(date(resolution_date))+1 DAY) as time,\n assignee_name as assignee,\n avg(lead_time_minutes)/1440 as lead_time\n from issues i\n where \n type = 'REQUIREMENT'\n and assignee_id != ''\n and $__timeFilter(resolution_date)\n group by 1,2\n),\n\n\nthis_month as(\n\tselect \n\t\tDATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY) as this_month\n),\n\nlast_month as(\n\tSELECT \n\t\tDATE_ADD(DATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY), INTERVAL -1 MONTH) as last_month\n),\n\nthe_month_before_last as(\n\tSELECT \n\t\tDATE_ADD(DATE_ADD(date(CURDATE()), INTERVAL -DAY(date(CURDATE()))+1 DAY), INTERVAL -2 MONTH) as the_month_before_last\n),\n\nthis_month_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as this_month_count,\n\t\ttime as this_month\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT this_month from this_month)\n),\n\nlast_month_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as last_month_count,\n\t\ttime as last_month\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT last_month from last_month)\n),\n\nthe_month_before_last_record as(\n\tSELECT\n\t\tassignee,\n\t\tlead_time as the_month_before_last_count,\n\t\ttime as the_month_before_last\n\tfrom _requirements\n\tWHERE \n\t\ttime in (SELECT the_month_before_last from the_month_before_last)\n)\n\nSELECT\n COALESCE(NULLIF(tmr.assignee,''), NULLIF(lmr.assignee,''), tmblr.assignee) AS 'Assignee',\n\tCOALESCE(tmblr.the_month_before_last_count,0) AS \"The Month before Last\",\n\tCOALESCE(lmr.last_month_count,0) AS \"Last Month\",\n\tCOALESCE(tmr.this_month_count,0) AS \"This Month\",\n\tcase \n\t when lmr.last_month_count is null or tmr.this_month_count is null then '-'\n\t else concat(FORMAT(100 * (tmr.this_month_count - lmr.last_month_count)/lmr.last_month_count,1),'%') end as \"Changes in last 2 month\"\nFrom the_month_before_last_record tmblr \n left join last_month_record lmr on tmblr.assignee = lmr.assignee\n left join this_month_record tmr on tmblr.assignee = tmr.assignee\norder by 2",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"type": "table"
},
{
"datasource": null,
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 20
},
"id": 102,
"options": {
"content": "<br/>\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).",
"mode": "markdown"
},
"pluginVersion": "8.0.6",
"targets": [
{
"queryType": "randomWalk",
"refId": "A"
}
],
"type": "text"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6M",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Demo-Average Requirement Lead Time By Assignee",
"uid": "q27fk7cnk",
"version": 6
}