From 4e1dbd1cf808c9cf1f310b6d498f7e304dfb4147 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Fri, 19 Jun 2020 22:04:01 +0000 Subject: 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 --- src/server/game/Maps/Map.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/server/game/Maps') 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()), + 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()), + TC_METRIC_TAG("map_id", std::to_string(GetId())), + TC_METRIC_TAG("map_instanceid", std::to_string(GetInstanceId()))); } struct ResetNotifier -- cgit v1.2.3