{ "__inputs": [ { "name": "DS_MYSQL", "label": "MySQL", "description": "", "type": "datasource", "pluginId": "mysql", "pluginName": "MySQL" } ], "__elements": {}, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "9.4.7" }, { "type": "datasource", "id": "mysql", "name": "MySQL", "version": "1.0.0" }, { "type": "panel", "id": "piechart", "name": "Pie chart", "version": "" }, { "type": "panel", "id": "table", "name": "Table", "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": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byType", "options": "number" }, "properties": [ { "id": "custom.width", "value": 100 } ] } ] }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 0 }, "id": 6, "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 startTime, map, layer, time_to_sec(timediff(endTime, startTime))/3600 as Length,\n (SELECT AVG(players)\n FROM DBLog_PlayerCounts as pc\n WHERE\n pc.`server` = $SERVER AND\n pc.`match` = $MATCH) as \"player count\",\n (SELECT AVG(publicQueue)\n FROM DBLog_PlayerCounts as pc\n WHERE\n pc.`server` = $SERVER AND\n pc.`match` = $MATCH) as \"queue count\",\n winner\nFROM DBLog_Matches\nWHERE\n`server` = $SERVER AND\n`id` = $MATCH", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Match Details", "type": "table" }, { "collapsed": true, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 4 }, "id": 12, "panels": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 5 }, "id": 9, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1\"\nFROM DBLog_Revives\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 1;", "refId": "Team 1", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2\"\nFROM DBLog_Revives\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 2;", "refId": "Team 2", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Revives", "type": "piechart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 5 }, "id": 10, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1\"\nFROM DBLog_Wounds\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nteamkill = 0 AND\nvictimTeamID = 1;", "refId": "Team 1", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2\"\nFROM DBLog_Wounds\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nteamkill = 0 AND\nvictimTeamID = 2;", "refId": "Team 2", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Wounded", "type": "piechart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 13 }, "id": 4, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1 Deaths\"\nFROM DBLog_Deaths\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 1;", "refId": "Team 1 Deaths", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1 Revives\"\nFROM DBLog_Revives\nWHERE\n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 1;", "refId": "Team 1 Revives", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 1 Revives and Deaths", "type": "piechart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 13 }, "id": 2, "options": { "displayLabels": [], "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "values": [] }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "/.*/", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "dataset": "squadjs", "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1 Kills\"\nFROM DBLog_Deaths\nWHERE `server` = $SERVER AND\n `match` = $MATCH AND\n teamkill = 0 AND\n attackerTeamID = 1", "refId": "Kills", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 1 Wounds\"\nFROM DBLog_Revives\nWHERE `server` = $SERVER AND\n `match` = $MATCH AND\n teamkill = 0 AND\n victimTeamID = 2", "refId": "Incaps", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 1 Kills and Incaps", "type": "piechart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 21 }, "id": 7, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2 Deaths\"\nFROM DBLog_Deaths\nWHERE \n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 2;", "refId": "Team 2 Deaths", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2 Revives\"\nFROM DBLog_Revives\nWHERE\n`server` = $SERVER AND\n`match` = $MATCH AND\nvictimTeamID = 2;", "refId": "Team 2 Revives", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 2 Revives and Deaths", "type": "piechart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 21 }, "id": 8, "options": { "displayLabels": [], "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "values": [] }, "pieType": "pie", "reduceOptions": { "calcs": [], "fields": "/.*/", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "dataset": "squadjs", "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2 Kills\"\nFROM DBLog_Deaths\nWHERE `server` = $SERVER AND\n `match` = $MATCH AND\n teamkill = 0 AND\n attackerTeamID = 2", "refId": "Kills", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(*) AS \"Team 2 Wounds\"\nFROM DBLog_Revives\nWHERE `server` = $SERVER AND\n `match` = $MATCH AND\n teamkill = 0 AND\n victimTeamID = 1", "refId": "Incaps", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 2 Kills and Incaps", "type": "piechart" } ], "title": "Match Stats", "type": "row" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }, "id": 14, "panels": [], "title": "Score Board", "type": "row" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "color-text" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "squadID" }, "properties": [ { "id": "custom.align", "value": "left" }, { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byType", "options": "number" }, "properties": [ { "id": "custom.width", "value": 100 } ] } ] }, "gridPos": { "h": 15, "w": 12, "x": 0, "y": 6 }, "id": 17, "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 lastName, killt.squadID, kills, deaths, incaps\nfrom (\n select attacker, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as kills\n from DBLog_Deaths\n where `match`=$MATCH and teamkill != 1\n group by attacker\n) as killt join (\n select victim, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as deaths\n from DBLog_Deaths\n where `match`=$MATCH and teamkill != 1\n group by victim\n) as deatht on killt.attacker=deatht.victim join (\n select attacker, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as incaps\n from DBLog_Wounds\n where `match`=$MATCH and teamkill != 1\n group by attacker\n) as woundt on killt.attacker=woundt.attacker join DBLog_SteamUsers on killt.attacker=DBLog_SteamUsers.steamID\nwhere killt.teamID=1\norder by squadID, kills desc, lastName", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 1", "type": "table" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "color-text" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "text", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "squadID" }, "properties": [ { "id": "custom.align", "value": "left" }, { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] }, { "matcher": { "id": "byType", "options": "number" }, "properties": [ { "id": "custom.width", "value": 100 } ] } ] }, "gridPos": { "h": 15, "w": 12, "x": 12, "y": 6 }, "id": 18, "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 lastName, killt.squadID, kills, deaths, incaps\nfrom (\n select attacker, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as kills\n from DBLog_Deaths\n where `match`=$MATCH and teamkill != 1\n group by attacker\n) as killt join (\n select victim, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as deaths\n from DBLog_Deaths\n where `match`=$MATCH and teamkill != 1\n group by victim\n) as deatht on killt.attacker=deatht.victim join (\n select attacker, attackerTeamID as teamID, attackerSquadID as squadID, count(*) as incaps\n from DBLog_Wounds\n where `match`=$MATCH and teamkill != 1\n group by attacker\n) as woundt on killt.attacker=woundt.attacker join DBLog_SteamUsers on killt.attacker=DBLog_SteamUsers.steamID\nwhere killt.teamID=2\norder by squadID, kills desc, lastName", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Team 2", "type": "table" } ], "refresh": "", "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, "label": "Server Name", "multi": false, "name": "SERVER", "options": [], "query": "SELECT id as __value, trim(leading '[ASG] Asgard Eternal | ' from name) as __text\nFROM DBLog_Servers", "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 3, "type": "query" }, { "current": {}, "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "definition": "SELECT dbmat.id\nFROM (\n SELECT mat.id, mat.layerClassname, mat.map, mat.layer, mat.startTime, mat.endTime, mat.winner, mat.server,\n (select avg(pc.players)\n from DBLog_PlayerCounts as pc\n where\n pc.`match`=mat.id\n ) as playercnt\n from DBLog_Matches as mat\n ) as dbmat\nWHERE server=$SERVER and playercnt>50 and winner is not null;", "hide": 0, "includeAll": false, "label": "Match ID", "multi": false, "name": "MATCH", "options": [], "query": "SELECT dbmat.id\nFROM (\n SELECT mat.id, mat.layerClassname, mat.map, mat.layer, mat.startTime, mat.endTime, mat.winner, mat.server,\n (select avg(pc.players)\n from DBLog_PlayerCounts as pc\n where\n pc.`match`=mat.id\n ) as playercnt\n from DBLog_Matches as mat\n ) as dbmat\nWHERE server=$SERVER and playercnt>50 and winner is not null;", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 4, "type": "query" } ] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Match info", "uid": "fCqwVL04z", "version": 18, "weekStart": "" }