grafana-dashboards/Server Overview.json
2023-05-02 12:17:43 -04:00

701 lines
17 KiB
JSON

{
"__inputs": [
{
"name": "DS_MYSQL",
"label": "MySQL",
"description": "",
"type": "datasource",
"pluginId": "mysql",
"pluginName": "MySQL"
}
],
"__elements": {},
"__requires": [
{
"type": "panel",
"id": "gauge",
"name": "Gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.4.7"
},
{
"type": "datasource",
"id": "mysql",
"name": "MySQL",
"version": "1.0.0"
},
{
"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"
},
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"enable": true,
"iconColor": "red",
"mappings": {
"id": {
"source": "field",
"value": "id"
},
"tags": {
"source": "field",
"value": "map"
},
"text": {
"source": "field",
"value": "layerClassname"
},
"time": {
"source": "field",
"value": "startTime"
},
"title": {
"source": "field",
"value": "layer"
}
},
"name": "Match Starts",
"target": {
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select *\r\nfrom DBLog_Matches\r\nwhere server = $SERVER",
"refId": "Anno",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
}
]
},
"description": "",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 2,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false,
"minWidth": 150
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byType",
"options": "number"
},
"properties": [
{
"id": "custom.width",
"value": 80
}
]
}
]
},
"gridPos": {
"h": 4,
"w": 24,
"x": 0,
"y": 0
},
"id": 10,
"options": {
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select (\n select trim(leading '[ASG] Asgard Eternal | ' from name)\n from DBLog_Servers\n where DBLog_Servers.id = $SERVER\n limit 1\n ) as 'Server Name',\n layer,startTime, id, (\n select players\n from DBLog_PlayerCounts\n where DBLog_PlayerCounts.server=$SERVER\n order by DBLog_PlayerCounts.id desc\n limit 1\n ) as players, (\n select publicQueue\n from DBLog_PlayerCounts\n where DBLog_PlayerCounts.server=$SERVER\n order by DBLog_PlayerCounts.id desc\n limit 1\n ) as queue,(\n select avg(players)\n from DBLog_PlayerCounts\n where DBLog_PlayerCounts.server=$SERVER and\n `match`=DBLog_Matches.id\n ) as 'avg players',(\n select avg(publicQueue)\n from DBLog_PlayerCounts\n where DBLog_PlayerCounts.server=$SERVER and\n `match`=DBLog_Matches.id\n ) as 'avg queue'\nfrom DBLog_Matches\nwhere\n endTime is null and\n server=$SERVER",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Server Info",
"type": "table"
},
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 98,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "#EAB839",
"value": 50
},
{
"color": "green",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 6,
"x": 0,
"y": 4
},
"id": 2,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\r\n time,\r\n players as \"Player Count\"\r\nFROM DBLog_PlayerCounts\r\nWHERE\r\n server=$SERVER\r\nGROUP BY 1\r\nORDER BY time DESC\r\nLIMIT 1",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Player Count",
"type": "gauge"
},
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "line"
}
},
"mappings": [],
"max": 110,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "red",
"value": 50
},
{
"color": "#EAB839",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "public_queue"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "dark-blue",
"mode": "fixed"
}
},
{
"id": "custom.lineWidth",
"value": 0
},
{
"id": "custom.fillOpacity",
"value": 100
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 18,
"x": 6,
"y": 4
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\r\n time,\r\n players as \"player_count\",\r\n publicQueue as \"public_queue\"\r\nFROM DBLog_PlayerCounts\r\nWHERE\r\n $__timeFilter(time) AND\r\n server=$SERVER\r\nGROUP BY 1\r\nORDER BY time",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Player Count",
"type": "timeseries"
},
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 60,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "orange",
"value": 15
},
{
"color": "green",
"value": 20
},
{
"color": "dark-green",
"value": 30
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 6,
"x": 0,
"y": 12
},
"id": 6,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\r\n time,\r\n tickRate\r\nFROM DBLog_TickRates\r\nWHERE\r\n server=$SERVER\r\nORDER BY time DESC\r\nLIMIT 1",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Tick Rate",
"type": "gauge"
},
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"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": "line"
}
},
"mappings": [],
"max": 60,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 15
},
{
"color": "#EAB839",
"value": 20
},
{
"color": "#6ED0E0",
"value": 30
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 18,
"x": 6,
"y": 12
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\r\n time,\r\n tickRate as \"tick rate\"\r\nFROM DBLog_TickRates\r\nWHERE\r\n $__timeFilter(time) and\r\n server=$SERVER\r\nORDER BY time DESC",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Panel Title",
"type": "timeseries"
}
],
"refresh": "10s",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {},
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"definition": "SELECT id as __value, trim(leading '[ASG] Asgard Eternal | ' from name) as __text\nFROM DBLog_Servers",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "SERVER",
"options": [],
"query": "SELECT id as __value, trim(leading '[ASG] Asgard Eternal | ' from name) as __text\nFROM DBLog_Servers",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Server Overview",
"uid": "YR5RDvJVz",
"version": 21,
"weekStart": ""
}