diff options
-rw-r--r-- | contrib/grafana/1_General.json | 1749 | ||||
-rw-r--r-- | contrib/grafana/2_Maps.json | 904 | ||||
-rw-r--r-- | contrib/grafana/3_Network.json | 426 | ||||
-rw-r--r-- | src/common/Metric/Metric.cpp | 3 | ||||
-rw-r--r-- | src/common/Metric/Metric.h | 54 | ||||
-rw-r--r-- | src/server/game/Maps/Map.cpp | 9 |
6 files changed, 1883 insertions, 1262 deletions
diff --git a/contrib/grafana/1_General.json b/contrib/grafana/1_General.json index e54791f190e..d89cf49476f 100644 --- a/contrib/grafana/1_General.json +++ b/contrib/grafana/1_General.json @@ -1,814 +1,1069 @@ { - "id": 1, - "title": "General info", - "originalTitle": "General info", - "tags": [], - "style": "dark", - "timezone": "browser", + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + }, + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, "editable": true, - "hideControls": false, - "sharedCrosshair": false, - "rows": [ + "gnetId": null, + "graphTooltip": 0, + "id": 5, + "iteration": 1592337582972, + "links": [], + "panels": [ { - "collapse": false, + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", "editable": true, - "height": "25px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "hideTimeOverride": false, + "id": 5, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "Influx", - "editable": true, - "error": false, - "format": "none", - "id": 5, - "interval": null, - "isNew": true, - "links": [], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "targets": [ + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "auto" - ], - "type": "time" - } - ], - "measurement": "online_players", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "type": "field", - "params": [ - "value" - ] - }, - { - "type": "last", - "params": [] - } - ] + "params": [ + "auto" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/^$realm$/" - } - ] + "type": "time" } ], - "thresholds": "", - "title": "Online players", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ + "measurement": "online_players", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ { - "op": "=", - "text": "N/A", - "value": "null" + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" } - ], - "valueName": "current", - "timeFrom": null, - "timeShift": null, - "hideTimeOverride": false + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "Online players", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 6, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "Influx", - "editable": true, - "error": false, - "format": "none", - "id": 6, - "interval": null, - "isNew": true, - "links": [], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "targets": [ + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "auto" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "auto" ], - "measurement": "update_time_diff", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "null" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/^$realm$/" - } - ] + "type": "fill" } ], - "thresholds": "", - "title": "Update diff (avg)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ + "measurement": "update_time_diff", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ { - "op": "=", - "text": "N/A", - "value": "null" + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" } - ], - "valueName": "avg", - "timeFrom": "1m" + ] + } + ], + "thresholds": "", + "timeFrom": "1m", + "title": "Update diff (avg)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 7, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "Influx", - "editable": true, - "error": false, - "format": "none", - "id": 7, - "interval": null, - "isNew": true, - "links": [], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "targets": [ + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "auto" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "auto" ], - "measurement": "update_time_diff", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "null" ], - "tags": [] + "type": "fill" } ], - "thresholds": "", - "title": "Update diff (avg)", - "transparent": false, - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ + "measurement": "update_time_diff", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ { - "op": "=", - "text": "N/A", - "value": "null" + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" } - ], - "valueName": "avg", - "timeFrom": "5m" + ] + } + ], + "thresholds": "", + "timeFrom": "5m", + "title": "Update diff (avg)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Influx", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} }, + "overrides": [] + }, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 8, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "Influx", - "editable": true, - "error": false, - "format": "none", - "id": 8, - "interval": null, - "isNew": true, - "links": [], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "span": 3, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "targets": [ + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "dsType": "influxdb", + "groupBy": [ { - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "auto" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "auto" ], - "measurement": "update_time_diff", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "null" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/^$realm$/" - } - ] + "type": "fill" } ], - "thresholds": "", - "title": "Update diff (avg)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ + "measurement": "update_time_diff", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ { - "op": "=", - "text": "N/A", - "value": "null" + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" } - ], - "valueName": "avg", - "timeFrom": "15m", - "timeShift": null + ] + } + ], + "thresholds": "", + "timeFrom": "15m", + "timeShift": null, + "title": "Update diff (avg)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" } ], - "title": "New row" + "valueName": "avg" }, { - "collapse": false, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", "editable": true, - "height": "250px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 3 + }, + "hiddenSeries": false, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 1, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "alias": "Update diff", + "dsType": "influxdb", + "groupBy": [ { - "alias": "Update diff", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "$interval" ], - "measurement": "update_time_diff", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"update_time_diff\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "null" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/$realm$/" - } - ] + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "Update diff", - "tooltip": { - "msResolution": false, - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "xaxis": { - "show": true - }, - "y-axis": true, - "y_formats": [ - "ms", - "short" + "measurement": "update_time_diff", + "policy": "default", + "query": "SELECT mean(\"value\") FROM \"update_time_diff\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] ], - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, + "tags": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "key": "realm", + "operator": "=~", + "value": "/$realm$/" } ] } ], - "title": "Row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Update diff", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "y-axis": true, + "y_formats": [ + "ms", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "collapse": false, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", "editable": true, - "height": "250px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 4, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 4, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "alias": "Online players", + "dsType": "influxdb", + "groupBy": [ { - "alias": "Online players", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "$interval" ], - "measurement": "online_players", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"online_players\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "null" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/$realm$/" - } - ] + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "Online players", - "tooltip": { - "msResolution": false, - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "xaxis": { - "show": true - }, - "y-axis": true, - "y_formats": [ - "short", - "short" + "measurement": "online_players", + "policy": "default", + "query": "SELECT mean(\"value\") FROM \"online_players\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] ], - "yaxes": [ + "tags": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "key": "realm", + "operator": "=~", + "value": "/$realm$/" } ] } ], - "title": "New row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Online players", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "collapse": false, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", "editable": true, - "height": "250px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 17 + }, + "hiddenSeries": false, + "id": 3, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 3, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Logouts", - "transform": "negative-Y" - } - ], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "alias": "Logouts", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Logins", + "dsType": "influxdb", + "groupBy": [ { - "alias": "Logins", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "$interval" ], - "measurement": "player_events", - "policy": "default", - "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Login' AND $timeFilter GROUP BY time($interval) fill(0)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "text" - ], - "type": "field" - }, - { - "params": [], - "type": "count" - } - ] - ], - "tags": [ - { - "key": "realm", - "operator": "=", - "value": "Trinity" - } - ] + "type": "time" }, { - "alias": "Logouts", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "policy": "default", - "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Logout' AND $timeFilter GROUP BY time($interval) fill(0)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "params": [ + "null" ], - "tags": [] + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "Player login/logout", - "tooltip": { - "msResolution": false, - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "xaxis": { - "show": true - }, - "y-axis": true, - "y_formats": [ - "short", - "short" + "measurement": "player_events", + "policy": "default", + "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Login' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "text" + ], + "type": "field" + }, + { + "params": [], + "type": "count" + } + ] ], - "yaxes": [ + "tags": [ + { + "key": "realm", + "operator": "=", + "value": "Trinity" + } + ] + }, + { + "alias": "Logouts", + "dsType": "influxdb", + "groupBy": [ { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "params": [ + "$interval" + ], + "type": "time" }, { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true + "params": [ + "null" + ], + "type": "fill" } - ] + ], + "policy": "default", + "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Logout' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], - "title": "New row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Player login/logout", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], + "refresh": "1m", + "schemaVersion": 25, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allFormat": "regex values", + "allValue": null, + "current": { + "selected": false, + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "definition": "", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [], + "query": "show tag values from events with key = realm", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, "time": { "from": "now-15m", "to": "now" @@ -816,7 +1071,6 @@ "timepicker": { "now": true, "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -839,51 +1093,8 @@ "30d" ] }, - "templating": { - "list": [ - { - "allFormat": "regex values", - "current": { - "text": "Trinity", - "value": "Trinity" - }, - "datasource": "Influx", - "includeAll": false, - "multi": false, - "multiFormat": "regex values", - "name": "realm", - "options": [ - { - "text": "Trinity", - "value": "Trinity", - "selected": true - } - ], - "query": "show tag values from events with key = realm", - "refresh": 1, - "regex": "", - "type": "query" - } - ] - }, - "annotations": { - "list": [ - { - "datasource": "Influx", - "enable": true, - "iconColor": "#C0C6BE", - "iconSize": 13, - "lineColor": "rgba(255, 96, 96, 0.592157)", - "name": "Global Events", - "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", - "showLine": true, - "textColumn": "text", - "titleColumn": "title" - } - ] - }, - "refresh": "1m", - "schemaVersion": 12, - "version": 7, - "links": [] + "timezone": "browser", + "title": "General info", + "uid": "BfuPZmZMz", + "version": 1 }
\ No newline at end of file diff --git a/contrib/grafana/2_Maps.json b/contrib/grafana/2_Maps.json index 6c2cecb1035..c8efcdf56f8 100644 --- a/contrib/grafana/2_Maps.json +++ b/contrib/grafana/2_Maps.json @@ -1,265 +1,660 @@ { - "id": 2, - "title": "Maps, vmaps and mmaps", - "originalTitle": "Maps, vmaps and mmaps", - "tags": [], - "style": "dark", - "timezone": "browser", + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + }, + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, "editable": true, - "hideControls": false, - "sharedCrosshair": false, - "rows": [ + "gnetId": null, + "graphTooltip": 0, + "id": 6, + "iteration": 1592337831334, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", + "editable": true, + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Unload tile", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Load tile", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'LoadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + }, + { + "alias": "Unload tile", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'UnloadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Map", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, { - "collapse": false, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", "editable": true, - "height": "250px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 7 + }, + "hiddenSeries": false, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 2, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ + "alias": "Pathfinding queries", + "dsType": "influxdb", + "groupBy": [ { - "alias": "Unload tile", - "transform": "negative-Y" + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" } ], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "query": "SELECT count(\"title\") FROM \"mmap_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'CalculatePath' AND $timeFilter GROUP BY time($interval) fill(0)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "MMap", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 14 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "Map $tag_map_id Instance $tag_map_instanceid", + "groupBy": [ { - "alias": "Load tile", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } + "params": [ + "$__interval" ], - "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'LoadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "map_id" ], - "tags": [] + "type": "tag" }, { - "alias": "Unload tile", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "map_instanceid" ], - "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'UnloadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "tag" + }, + { + "params": [ + "none" ], - "tags": [] + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "Map", - "tooltip": { - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "y-axis": true, - "y_formats": [ - "short", - "short" + "measurement": "map_creatures", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" + } ] } ], - "title": "Row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Creatures", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 5, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 22 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 1, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "alias": "Map $tag_map_id Instance $tag_map_instanceid", + "groupBy": [ { - "alias": "Pathfinding queries", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } + "params": [ + "$__interval" ], - "query": "SELECT count(\"title\") FROM \"mmap_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'CalculatePath' AND $timeFilter GROUP BY time($interval) fill(0)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "map_id" ], - "tags": [] + "type": "tag" + }, + { + "params": [ + "map_instanceid" + ], + "type": "tag" + }, + { + "params": [ + "none" + ], + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "MMap", - "tooltip": { - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "y-axis": true, - "y_formats": [ - "short", - "short" + "measurement": "map_gameobjects", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/^$realm$/" + } ] } ], - "title": "New row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Gameobjects", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], + "refresh": "1m", + "schemaVersion": 25, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allFormat": "regex values", + "allValue": null, + "current": { + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "definition": "", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [], + "query": "show tag values from events with key = realm", + "refresh": true, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, "time": { "from": "now-15m", "to": "now" @@ -267,7 +662,6 @@ "timepicker": { "now": true, "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -290,50 +684,8 @@ "30d" ] }, - "templating": { - "list": [ - { - "allFormat": "regex values", - "current": { - "text": "Trinity", - "value": "Trinity" - }, - "datasource": "Influx", - "includeAll": false, - "multi": false, - "multiFormat": "regex values", - "name": "realm", - "options": [ - { - "text": "Trinity", - "value": "Trinity", - "selected": true - } - ], - "query": "show tag values from events with key = realm", - "refresh": true, - "type": "query" - } - ] - }, - "annotations": { - "list": [ - { - "datasource": "Influx", - "enable": true, - "iconColor": "#C0C6BE", - "iconSize": 13, - "lineColor": "rgba(255, 96, 96, 0.592157)", - "name": "Global Events", - "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", - "showLine": true, - "textColumn": "text", - "titleColumn": "title" - } - ] - }, - "refresh": "1m", - "schemaVersion": 8, - "version": 11, - "links": [] + "timezone": "browser", + "title": "Maps, vmaps and mmaps", + "uid": "6IhqWiWGz", + "version": 1 }
\ No newline at end of file diff --git a/contrib/grafana/3_Network.json b/contrib/grafana/3_Network.json index 98c190e1185..4d26a179d8b 100644 --- a/contrib/grafana/3_Network.json +++ b/contrib/grafana/3_Network.json @@ -1,168 +1,249 @@ { - "id": 3, - "title": "Network", - "originalTitle": "Network", - "tags": [], - "style": "dark", - "timezone": "browser", + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + }, + { + "datasource": "Influx", + "enable": true, + "iconColor": "#C0C6BE", + "iconSize": 13, + "lineColor": "rgba(255, 96, 96, 0.592157)", + "name": "Global Events", + "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", + "showLine": true, + "textColumn": "text", + "titleColumn": "title" + } + ] + }, "editable": true, - "hideControls": false, - "sharedCrosshair": false, - "rows": [ + "gnetId": null, + "graphTooltip": 0, + "id": 7, + "iteration": 1592337929176, + "links": [], + "panels": [ { - "collapse": false, + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Influx", "editable": true, - "height": "250px", - "panels": [ + "error": false, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "grid": {}, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ { - "aliasColors": {}, - "bars": false, - "datasource": "Influx", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "leftLogBase": 1, - "leftMax": null, - "leftMin": null, - "rightLogBase": 1, - "rightMax": null, - "rightMin": null, - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 1, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ + "alias": "Processed packets", + "dsType": "influxdb", + "groupBy": [ { - "alias": "Processed packets", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } + "params": [ + "$interval" ], - "measurement": "processed_packets", - "query": "SELECT sum(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "sum" - } - ] - ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/$realm$/" - } - ] + "type": "time" }, { - "alias": "Processed packets / mean per session", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "0" - ], - "type": "fill" - } + "params": [ + "0" + ], + "type": "fill" + } + ], + "measurement": "processed_packets", + "query": "SELECT sum(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } + ] + }, + { + "alias": "Processed packets / mean per session", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" ], - "measurement": "processed_packets", - "query": "SELECT mean(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] + "type": "time" + }, + { + "params": [ + "0" ], - "tags": [ - { - "key": "realm", - "operator": "=~", - "value": "/$realm$/" - } - ] + "type": "fill" } ], - "timeFrom": null, - "timeShift": null, - "title": "Processed packets", - "tooltip": { - "shared": true, - "value_type": "cumulative" - }, - "type": "graph", - "x-axis": true, - "y-axis": true, - "y_formats": [ - "short", - "short" + "measurement": "processed_packets", + "query": "SELECT mean(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "realm", + "operator": "=~", + "value": "/$realm$/" + } ] } ], - "title": "Row" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Processed packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], + "refresh": "1m", + "schemaVersion": 25, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allFormat": "regex values", + "allValue": null, + "current": { + "text": "Trinity", + "value": "Trinity" + }, + "datasource": "Influx", + "definition": "", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "multiFormat": "regex values", + "name": "realm", + "options": [], + "query": "show tag values from events with key = realm", + "refresh": true, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, "time": { "from": "now-15m", "to": "now" @@ -170,7 +251,6 @@ "timepicker": { "now": true, "refresh_intervals": [ - "5s", "10s", "30s", "1m", @@ -193,50 +273,8 @@ "30d" ] }, - "templating": { - "list": [ - { - "allFormat": "regex values", - "current": { - "text": "Trinity", - "value": "Trinity" - }, - "datasource": "Influx", - "includeAll": false, - "multi": false, - "multiFormat": "regex values", - "name": "realm", - "options": [ - { - "text": "Trinity", - "value": "Trinity", - "selected": true - } - ], - "query": "show tag values from events with key = realm", - "refresh": true, - "type": "query" - } - ] - }, - "annotations": { - "list": [ - { - "datasource": "Influx", - "enable": true, - "iconColor": "#C0C6BE", - "iconSize": 13, - "lineColor": "rgba(255, 96, 96, 0.592157)", - "name": "Global Events", - "query": "select title, text from events where $timeFilter and realm =~ /$realm$/", - "showLine": true, - "textColumn": "text", - "titleColumn": "title" - } - ] - }, - "refresh": "1m", - "schemaVersion": 8, - "version": 7, - "links": [] + "timezone": "browser", + "title": "Network", + "uid": "_QtkMmWMk", + "version": 1 }
\ No newline at end of file diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp index f4d0661dcaf..b1302aacb5a 100644 --- a/src/common/Metric/Metric.cpp +++ b/src/common/Metric/Metric.cpp @@ -136,6 +136,9 @@ void Metric::SendBatch() if (!_realmName.empty()) batchedData << ",realm=" << _realmName; + for (MetricTag const& tag : data->Tags) + batchedData << "," << tag.first << "=" << tag.second; + batchedData << " "; switch (data->Type) diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h index 1182db6b501..d46e0566130 100644 --- a/src/common/Metric/Metric.h +++ b/src/common/Metric/Metric.h @@ -25,6 +25,8 @@ #include <iosfwd> #include <memory> #include <string> +#include <vector> +#include <utility> namespace Trinity { @@ -41,11 +43,14 @@ enum MetricDataType METRIC_DATA_EVENT }; +typedef std::pair<std::string, std::string> MetricTag; + struct MetricData { std::string Category; std::chrono::system_clock::time_point Timestamp; MetricDataType Type; + std::vector<MetricTag> Tags; // LogValue-specific fields std::string Value; @@ -100,7 +105,7 @@ public: void Update(); template<class T> - void LogValue(std::string const& category, T value) + void LogValue(std::string const& category, T value, std::vector<MetricTag> tags) { using namespace std::chrono; @@ -109,6 +114,7 @@ public: data->Timestamp = system_clock::now(); data->Type = METRIC_DATA_VALUE; data->Value = FormatInfluxDBValue(value); + data->Tags = std::move(tags); _queuedData.Enqueue(data); } @@ -121,36 +127,38 @@ public: #define sMetric Metric::instance() +#define TC_METRIC_TAG(name, value) { name, value } + #ifdef PERFORMANCE_PROFILING #define TC_METRIC_EVENT(category, title, description) ((void)0) #define TC_METRIC_VALUE(category, value) ((void)0) #elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS -#define TC_METRIC_EVENT(category, title, description) \ - do { \ - if (sMetric->IsEnabled()) \ - sMetric->LogEvent(category, title, description); \ +#define TC_METRIC_EVENT(category, title, description) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogEvent(category, title, description); \ } while (0) -#define TC_METRIC_VALUE(category, value) \ - do { \ - if (sMetric->IsEnabled()) \ - sMetric->LogValue(category, value); \ +#define TC_METRIC_VALUE(category, value, ...) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogValue(category, value, { __VA_ARGS__ }); \ } while (0) #else -#define TC_METRIC_EVENT(category, title, description) \ - __pragma(warning(push)) \ - __pragma(warning(disable:4127)) \ - do { \ - if (sMetric->IsEnabled()) \ - sMetric->LogEvent(category, title, description); \ - } while (0) \ +#define TC_METRIC_EVENT(category, title, description) \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogEvent(category, title, description); \ + } while (0) \ __pragma(warning(pop)) -#define TC_METRIC_VALUE(category, value) \ - __pragma(warning(push)) \ - __pragma(warning(disable:4127)) \ - do { \ - if (sMetric->IsEnabled()) \ - sMetric->LogValue(category, value); \ - } while (0) \ +#define TC_METRIC_VALUE(category, value, ...) \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) \ + do { \ + if (sMetric->IsEnabled()) \ + sMetric->LogValue(category, value, { __VA_ARGS__ }); \ + } while (0) \ __pragma(warning(pop)) #endif diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 1df76fd4f0a..d3d32e55846 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -36,6 +36,7 @@ #include "Log.h" #include "MapInstanced.h" #include "MapManager.h" +#include "Metric.h" #include "MiscPackets.h" #include "MMapFactory.h" #include "MotionMaster.h" @@ -964,6 +965,14 @@ void Map::Update(uint32 t_diff) ProcessRelocationNotifies(t_diff); sScriptMgr->OnMapUpdate(this, t_diff); + + TC_METRIC_VALUE("map_creatures", uint64(GetObjectsStore().Size<Creature>()), + TC_METRIC_TAG("map_id", std::to_string(GetId())), + TC_METRIC_TAG("map_instanceid", std::to_string(GetInstanceId()))); + + TC_METRIC_VALUE("map_gameobjects", uint64(GetObjectsStore().Size<GameObject>()), + TC_METRIC_TAG("map_id", std::to_string(GetId())), + TC_METRIC_TAG("map_instanceid", std::to_string(GetInstanceId()))); } struct ResetNotifier |