diff --git a/server/imserver/MSConn.h b/server/imserver/MSConn.h index 982a020..867e84b 100644 --- a/server/imserver/MSConn.h +++ b/server/imserver/MSConn.h @@ -3,6 +3,8 @@ #include "framework/cpp/protoutils.h" #include "framework/cpp/netmsghandler.h" +#include "perfmonitor.h" + namespace a8 { class AsyncTcpClient; @@ -30,6 +32,7 @@ class MSConn { static int msgid = f8::Net_GetMessageId(msg); f8::Net_SendMsg(tcp_client_, 0, msgid, msg); + ++PerfMonitor::Instance()->ms_send_times; #ifdef DEBUG f8::DumpMsgToLog(msg, "<<<<<<ms_send_times; #ifdef DEBUG f8::DumpMsgToLog(msg, "<<<<<<max_run_delay_time, PerfMonitor::Instance()->max_timer_idle, @@ -33,7 +34,9 @@ static void SavePerfLog() PerfMonitor::Instance()->send_ws_count, (long long)f8::DBPool::Instance()->total_query_num, (long long)f8::DBPool::Instance()->exec_query_num, - (long long)f8::DBPool::Instance()->run_loop_num + (long long)f8::DBPool::Instance()->run_loop_num, + PerfMonitor::Instance()->ms_send_times, + PerfMonitor::Instance()->ms_recv_times }); a8::UdpLog::Instance()->Info ("run_times:%d timer_times:%d event_times:%d free_times:%d " diff --git a/server/imserver/perfmonitor.h b/server/imserver/perfmonitor.h index 57dbb00..f151869 100644 --- a/server/imserver/perfmonitor.h +++ b/server/imserver/perfmonitor.h @@ -17,6 +17,8 @@ class PerfMonitor : public a8::Singleton long long in_data_size = 0; long long read_count = 0; long long send_ws_count = 0; + long long ms_send_times = 0; + long long ms_recv_times = 0; void Init(); void UnInit(); diff --git a/server/imserver/playermgr.cc b/server/imserver/playermgr.cc index b72bebd..22644e2 100644 --- a/server/imserver/playermgr.cc +++ b/server/imserver/playermgr.cc @@ -87,6 +87,7 @@ void PlayerMgr::_SS_IM_FriendApply(f8::MsgHdr& hdr, const ss::SS_IM_FriendApply& void PlayerMgr::_SS_IM_OnUserOnline(f8::MsgHdr& hdr, const ss::SS_IM_OnUserOnline& msg) { + int times = 0; for (auto& account_id : msg.account_ids()) { auto itr = watch_players_.find(account_id); if (itr != watch_players_.end()) { @@ -94,6 +95,16 @@ void PlayerMgr::_SS_IM_OnUserOnline(f8::MsgHdr& hdr, const ss::SS_IM_OnUserOnlin list_for_each_entry_safe(node, tmp, &itr->second, watch_node) { node->base_data.online = true; node->hum->NotifyUserInfoUpdate(node); + ++times; + if (times > 100) { + a8::UdpLog::Instance()->Warning + ("OnUserOnLine watch account_id:%s times:%d ", + { + account_id, + times + }); + break; + } } } } @@ -101,6 +112,7 @@ void PlayerMgr::_SS_IM_OnUserOnline(f8::MsgHdr& hdr, const ss::SS_IM_OnUserOnlin void PlayerMgr::_SS_IM_OnUserOffline(f8::MsgHdr& hdr, const ss::SS_IM_OnUserOffline& msg) { + int times = 0; for (auto& account_id : msg.account_ids()) { auto itr = watch_players_.find(account_id); if (itr != watch_players_.end()) { @@ -108,6 +120,16 @@ void PlayerMgr::_SS_IM_OnUserOffline(f8::MsgHdr& hdr, const ss::SS_IM_OnUserOffl list_for_each_entry_safe(node, tmp, &itr->second, watch_node) { node->base_data.online = false; node->hum->NotifyUserInfoUpdate(node); + ++times; + if (times > 100) { + a8::UdpLog::Instance()->Warning + ("OnUserOffLine watch account_id:%s times:%d ", + { + account_id, + times + }); + break; + } } } } diff --git a/third_party/a8engine b/third_party/a8engine index 645913c..d6786bc 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit 645913c9d4cc7126475f110b3c7d55bc2f4bc5f0 +Subproject commit d6786bcdb167afad09bcad7d34e247879dfc735a