Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patrickdevivo/8bbe1d8956853329bbc5c7175ede8950 to your computer and use it in GitHub Desktop.
Save patrickdevivo/8bbe1d8956853329bbc5c7175ede8950 to your computer and use it in GitHub Desktop.
{
"__inputs": [
{
"name": "DS_MERGESTAT_INTERNAL",
"label": "MergeStat Internal",
"description": "",
"type": "datasource",
"pluginId": "postgres",
"pluginName": "PostgreSQL"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "barchart",
"name": "Bar chart",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.4.1-30f3f63"
},
{
"type": "panel",
"id": "heatmap",
"name": "Heatmap",
"version": ""
},
{
"type": "datasource",
"id": "postgres",
"name": "PostgreSQL",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "text",
"value": null
}
]
},
"unit": "dateTimeAsLocalNoDateIfToday"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 0,
"y": 0
},
"id": 7,
"options": {
"colorMode": "none",
"graphMode": "area",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^committer_when$/",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.4.1-30f3f63",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT name, committer_when\nFROM git_tags\nJOIN repos ON git_tags.repo_id = repos.id\nJOIN git_commits ON git_tags.tag_commit_hash = git_commits.hash\nWHERE repo = 'https://github.com/mergestat/mergestat'\nORDER BY committer_when DESC LIMIT 1\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Date of Last Release",
"type": "stat"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"description": "How long it's been since the last MergeStat release.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 7
},
{
"color": "red",
"value": 14
}
]
},
"unit": "d"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 5,
"y": 0
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/^days_since_last_release$/",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.4.1-30f3f63",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT name, committer_when, ROUND(EXTRACT(EPOCH FROM now() - committer_when)/(86400), 2) AS days_since_last_release\nFROM git_tags\nJOIN repos ON git_tags.repo_id = repos.id\nJOIN git_commits ON git_tags.tag_commit_hash = git_commits.hash\nWHERE repo = 'https://github.com/mergestat/mergestat'\nORDER BY committer_when DESC LIMIT 1\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Time Since Last Release",
"type": "stat"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"description": "The average (mean) time between releases of MergeStat",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 7
},
{
"color": "red",
"value": 14
}
]
},
"unit": "d"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 5,
"x": 10,
"y": 0
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.4.1-30f3f63",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "WITH tags AS (\n SELECT\n name, committer_when,\n committer_when - LAG(committer_when) OVER (ORDER BY committer_when) AS since_prev_tag\n FROM git_tags\n JOIN repos ON git_tags.repo_id = repos.id\n JOIN git_commits ON git_tags.tag_commit_hash = git_commits.hash\n WHERE repo = 'https://github.com/mergestat/mergestat'\n AND author_when > now() - '90 days'::interval\n ORDER BY committer_when ASC\n)\nSELECT ROUND(EXTRACT(EPOCH FROM avg(since_prev_tag))/(86400), 2) AS mean_time_between_releases\nFROM tags\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "90d Mean Time Between MergeStat Releases",
"type": "stat"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"fieldConfig": {
"defaults": {
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"scaleDistribution": {
"type": "linear"
}
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 9,
"x": 15,
"y": 0
},
"id": 9,
"options": {
"calculate": true,
"calculation": {
"xBuckets": {
"mode": "size",
"value": "1w"
},
"yBuckets": {
"mode": "size"
}
},
"cellGap": 1,
"cellValues": {
"unit": "Releases"
},
"color": {
"exponent": 0.5,
"fill": "dark-purple",
"min": 0.5,
"mode": "opacity",
"reverse": false,
"scale": "linear",
"scheme": "PuBu",
"steps": 64
},
"exemplars": {
"color": "dark-purple"
},
"filterValues": {
"le": 1e-9
},
"legend": {
"show": true
},
"rowsFrame": {
"layout": "auto"
},
"tooltip": {
"show": true,
"yHistogram": false
},
"yAxis": {
"axisPlacement": "hidden",
"reverse": false
}
},
"pluginVersion": "9.4.1-30f3f63",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "WITH tags AS (\n SELECT\n 1, name as count, committer_when as time\n FROM git_tags\n JOIN repos ON git_tags.repo_id = repos.id\n JOIN git_commits ON git_tags.tag_commit_hash = git_commits.hash\n WHERE repo = 'https://github.com/mergestat/mergestat'\n AND author_when > now() - '90 days'::interval\n ORDER BY committer_when ASC\n)\nSELECT * FROM tags\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Release Count Heatmap (by week)",
"type": "heatmap"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"description": "For every release, show how long (in days) it's been since the previous release.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "dashed+area"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 7
},
{
"color": "red",
"value": 14
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 8
},
"id": 6,
"options": {
"barRadius": 0,
"barWidth": 0.97,
"colorByField": "since_prev_tag",
"fullHighlight": true,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"orientation": "vertical",
"showValue": "never",
"stacking": "none",
"tooltip": {
"mode": "multi",
"sort": "none"
},
"xField": "name",
"xTickLabelRotation": 45,
"xTickLabelSpacing": 0
},
"pluginVersion": "9.4.1-30f3f63",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_MERGESTAT_INTERNAL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "WITH tags AS (\n SELECT\n name, committer_when,\n ROUND(EXTRACT(EPOCH FROM committer_when - LAG(committer_when) OVER (ORDER BY committer_when))/86400) AS since_prev_tag\n FROM git_tags\n JOIN repos ON git_tags.repo_id = repos.id\n JOIN git_commits ON git_tags.tag_commit_hash = git_commits.hash\n WHERE repo = 'https://github.com/mergestat/mergestat'\n AND author_when > now() - '90 days'::interval\n ORDER BY committer_when ASC\n)\nSELECT * FROM tags\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Days Since Last Release, by Release",
"type": "barchart"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-90d",
"to": "now"
},
"timepicker": {
"hidden": true
},
"timezone": "",
"title": "Releases",
"uid": "aKIMcSxVz",
"version": 17,
"weekStart": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment