mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
feat(Core/Metrics): implement real time statistic visualization (#8663)
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "GitRevision.h"
|
||||
#include "IoContext.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Metric.h"
|
||||
#include "MySQLThreading.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "OpenSSLCrypto.h"
|
||||
@@ -288,6 +289,22 @@ int main(int argc, char** argv)
|
||||
|
||||
LoadRealmInfo(*ioContext);
|
||||
|
||||
sMetric->Initialize(realm.Name, *ioContext, []()
|
||||
{
|
||||
METRIC_VALUE("online_players", sWorld->GetPlayerCount());
|
||||
METRIC_VALUE("db_queue_login", uint64(LoginDatabase.QueueSize()));
|
||||
METRIC_VALUE("db_queue_character", uint64(CharacterDatabase.QueueSize()));
|
||||
METRIC_VALUE("db_queue_world", uint64(WorldDatabase.QueueSize()));
|
||||
});
|
||||
|
||||
METRIC_EVENT("events", "Worldserver started", "");
|
||||
|
||||
std::shared_ptr<void> sMetricHandle(nullptr, [](void*)
|
||||
{
|
||||
METRIC_EVENT("events", "Worldserver shutdown", "");
|
||||
sMetric->Unload();
|
||||
});
|
||||
|
||||
// Loading modules configs
|
||||
sConfigMgr->PrintLoadedModulesConfigs();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user