mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Core/Metrics): implement real time statistic visualization (#8663)
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "Hyperlinks.h"
|
||||
#include "Log.h"
|
||||
#include "MapMgr.h"
|
||||
#include "Metric.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
@@ -319,6 +320,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
OpcodeClient opcode = static_cast<OpcodeClient>(packet->GetOpcode());
|
||||
ClientOpcodeHandler const* opHandle = opcodeTable[opcode];
|
||||
|
||||
METRIC_DETAILED_TIMER("worldsession_update_opcode_time", METRIC_TAG("opcode", opHandle->Name));
|
||||
|
||||
try
|
||||
{
|
||||
switch (opHandle->Status)
|
||||
@@ -441,6 +444,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
|
||||
_recvQueue.readd(requeuePackets.begin(), requeuePackets.end());
|
||||
|
||||
METRIC_VALUE("processed_packets", processedPackets);
|
||||
|
||||
if (!updater.ProcessUnsafe()) // <=> updater is of type MapSessionFilter
|
||||
{
|
||||
// Send time sync packet every 10s.
|
||||
@@ -671,6 +676,8 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
//! Call script hook before deletion
|
||||
sScriptMgr->OnPlayerLogout(_player);
|
||||
|
||||
METRIC_EVENT("player_events", "Logout", _player->GetName());
|
||||
|
||||
LOG_INFO("entities.player", "Account: %d (IP: %s) Logout Character:[%s] (%s) Level: %d",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->getLevel());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user