feat(Core/Metrics): implement real time statistic visualization (#8663)

This commit is contained in:
Kargatum
2021-10-28 19:47:29 +07:00
committed by GitHub
parent 7c363c9040
commit a650fd495c
21 changed files with 4798 additions and 31 deletions

View File

@@ -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());