aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-06-19 22:04:01 +0000
committerGitHub <noreply@github.com>2020-06-20 00:04:01 +0200
commit4e1dbd1cf808c9cf1f310b6d498f7e304dfb4147 (patch)
tree17b33b97a5c9b40abd1b045b5171958102f17b81 /src/server
parent56d60ee00c094464082e3ed2a70d669d415ca49c (diff)
Log number of Creatures and GameObject per map (#24809)
* Shared/Metric: Allow to specify tags in metrics * Core/Metric: Log number of Creatures and GameObject per map * Apply feedback * Codestyle changes * Codestyle changes * Remove whitespace * Update Grafana dashboards to v7.0.3 * Fix missing filter on realm * Include Creatures and Gameobjects in Maps dashboard * Show instances with a different color
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/Maps/Map.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index e75c09a509f..07298fe02e0 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -31,6 +31,7 @@
#include "Log.h"
#include "MapInstanced.h"
#include "MapManager.h"
+#include "Metric.h"
#include "MiscPackets.h"
#include "MMapFactory.h"
#include "MotionMaster.h"
@@ -879,6 +880,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