Skip to content

Instantly share code, notes, and snippets.

@InventivetalentDev
Created November 2, 2022 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InventivetalentDev/03b64b8fe516d86cebd2d1f3405c57cc to your computer and use it in GitHub Desktop.
Save InventivetalentDev/03b64b8fe516d86cebd2d1f3405c57cc to your computer and use it in GitHub Desktop.
OCRWatch example dashboard
{
"__inputs": [
{
"name": "DS_INFLUXDB_V2_FLUX",
"label": "InfluxDB_v2_Flux",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.1.8"
},
{
"type": "datasource",
"id": "influxdb",
"name": "InfluxDB",
"version": "1.0.0"
},
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"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",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto",
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"frameIndex": 1,
"showHeader": true
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"key": "Q-bcc4b606-b6b6-4398-9b84-fd6b047e0830-0",
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n \r\n |> group()\r\n |> last()\r\n |> drop(columns:[\"_start\",\"_stop\",\"_field\",\"_value\",\"_measurement\"])\r\n ",
"refId": "A"
}
],
"title": "Latest Match",
"transformations": [],
"type": "table"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 4
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"key": "Q-bcc4b606-b6b6-4398-9b84-fd6b047e0830-0",
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n",
"refId": "A"
}
],
"title": "Time",
"type": "timeseries"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 14
},
"id": 5,
"options": {
"legend": {
"calcs": [
"last"
],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"key": "Q-bcc4b606-b6b6-4398-9b84-fd6b047e0830-0",
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field != \"duration\")\r\n \r\n |> drop(columns:[\"hero\",\"state\"])",
"refId": "A"
}
],
"title": "Player Stats",
"type": "timeseries"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"_value",
"MERCY state",
"MERCY loss"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 0,
"y": 26
},
"id": 4,
"options": {
"displayLabels": [
"percent",
"name"
],
"legend": {
"displayMode": "table",
"placement": "right",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n |> filter(fn: (r) =>\r\n r.state == \"win\" or r.state == \"loss\" or r.state == \"draw\"\r\n )\r\n \r\n |> group(columns: [\"hero\",\"state\"], mode:\"by\")\r\n\r\n |> count()\r\n |> keep(columns: [\"hero\", \"state\",\"_value\"])\r\n\r\n ",
"refId": "A"
}
],
"title": "Result by Hero",
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "columns"
}
}
],
"type": "piechart"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"_value",
"MERCY state",
"MERCY loss"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 8,
"y": 26
},
"id": 9,
"options": {
"displayLabels": [
"percent",
"name"
],
"legend": {
"displayMode": "table",
"placement": "right",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n |> filter(fn: (r) =>\r\n r.state == \"win\" or r.state == \"loss\" or r.state == \"draw\"\r\n )\r\n \r\n |> group(columns: [\"state\"], mode:\"by\")\r\n\r\n |> count()\r\n |> keep(columns: [\"mode\", \"state\",\"_value\"])\r\n\r\n ",
"refId": "A"
}
],
"title": "Win vs Loss",
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "columns"
}
}
],
"type": "piechart"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"_value",
"MERCY state",
"MERCY loss"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 26
},
"id": 7,
"options": {
"displayLabels": [
"percent",
"name"
],
"legend": {
"displayMode": "table",
"placement": "right",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n |> filter(fn: (r) =>\r\n r.state == \"win\" or r.state == \"loss\" or r.state == \"draw\"\r\n )\r\n \r\n |> group(columns: [\"mode\",\"state\"], mode:\"by\")\r\n\r\n |> count()\r\n |> keep(columns: [\"mode\", \"state\",\"_value\"])\r\n\r\n ",
"refId": "A"
}
],
"title": "Result by Mode",
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "columns"
}
}
],
"type": "piechart"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [
{
"options": {
"false": {
"index": 1,
"text": "Quick Play"
},
"true": {
"index": 0,
"text": "Competitive"
}
},
"type": "value"
}
]
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"_value",
"MERCY state",
"MERCY loss"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 0,
"y": 34
},
"id": 8,
"options": {
"displayLabels": [
"percent",
"name"
],
"legend": {
"displayMode": "table",
"placement": "right",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n |> filter(fn: (r) =>\r\n r.state == \"win\" or r.state == \"loss\" or r.state == \"draw\"\r\n )\r\n \r\n |> group(columns: [\"competitive\",\"state\"], mode:\"by\")\r\n\r\n |> count()\r\n |> keep(columns: [\"competitive\", \"state\",\"_value\"])\r\n\r\n ",
"refId": "A"
}
],
"title": "Competitive vs Quick Play",
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "columns"
}
}
],
"type": "piechart"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"_value",
"MERCY state",
"MERCY loss"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 8,
"y": 34
},
"id": 6,
"options": {
"displayLabels": [
"percent",
"name"
],
"legend": {
"displayMode": "table",
"placement": "right",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.8",
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"match_stats\")\r\n |> filter(fn:(r)=>r._field == \"duration\")\r\n |> filter(fn: (r) =>\r\n r.state == \"win\" or r.state == \"loss\" or r.state == \"draw\"\r\n )\r\n \r\n |> group(columns: [\"map\",\"state\"], mode:\"by\")\r\n\r\n |> count()\r\n |> keep(columns: [\"map\", \"state\",\"_value\"])\r\n\r\n ",
"refId": "A"
}
],
"title": "Result by Map",
"transformations": [
{
"id": "labelsToFields",
"options": {
"mode": "columns"
}
}
],
"type": "piechart"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 42
},
"id": 11,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB_V2_FLUX}"
},
"query": "from(bucket: \"overwatch\")\r\n |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n |> filter(fn:(r)=>r._measurement == \"rank\")\r\n |> filter(fn:(r)=>r._field == \"rank\")\r\n",
"refId": "A"
}
],
"title": "Rank",
"type": "timeseries"
}
],
"refresh": "10s",
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "OCRwatch",
"uid": "Wsj7BNHVk",
"version": 25,
"weekStart": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment