This commit is contained in:
aozhiwei 2020-07-10 10:40:18 +08:00
parent dc613359c9
commit 0c8a248450
3 changed files with 9 additions and 2 deletions

View File

@ -2,6 +2,8 @@
#include "framework/cpp/netmsghandler.h" #include "framework/cpp/netmsghandler.h"
#include "perfmonitor.h"
//gate listener //gate listener
namespace a8 namespace a8
{ {
@ -31,6 +33,7 @@ class WSListener : public a8::Singleton<WSListener>
{ {
static int msgid = f8::Net_GetMessageId(msg); static int msgid = f8::Net_GetMessageId(msg);
f8::Net_SendProxyMsg(tcp_listener_, sockhandle, 0, 0, msgid, msg); f8::Net_SendProxyMsg(tcp_listener_, sockhandle, 0, 0, msgid, msg);
++PerfMonitor::Instance()->send_ws_count;
#ifdef DEBUG #ifdef DEBUG
f8::DumpMsgToLog(msg, "<<<<<<<WSL "); f8::DumpMsgToLog(msg, "<<<<<<<WSL ");
#endif #endif
@ -41,6 +44,7 @@ class WSListener : public a8::Singleton<WSListener>
{ {
static int msgid = f8::Net_GetMessageId(msg); static int msgid = f8::Net_GetMessageId(msg);
f8::Net_SendProxyMsg(tcp_listener_, sockhandle, seqid, 0, msgid, msg); f8::Net_SendProxyMsg(tcp_listener_, sockhandle, seqid, 0, msgid, msg);
++PerfMonitor::Instance()->send_ws_count;
#ifdef DEBUG #ifdef DEBUG
f8::DumpMsgToLog(msg, "<<<<<<<WSL "); f8::DumpMsgToLog(msg, "<<<<<<<WSL ");
#endif #endif

View File

@ -13,7 +13,8 @@ static void SavePerfLog()
a8::UdpLog::Instance()->Info a8::UdpLog::Instance()->Info
("max_run_delay_time:%d max_timer_idle:%d " ("max_run_delay_time:%d max_timer_idle:%d "
"in_data_size:%d out_data_size:%d msgnode_size:%d read_count:%d max_login_time:%d " "in_data_size:%d out_data_size:%d msgnode_size:%d read_count:%d max_login_time:%d "
"login_ok_time:%d login_error_time:%d online_num:%d watch_num:%d cache_users_num:%d ", "login_ok_time:%d login_error_time:%d online_num:%d watch_num:%d cache_users_num:%d "
"send_ws_count:%d ",
{ {
PerfMonitor::Instance()->max_run_delay_time, PerfMonitor::Instance()->max_run_delay_time,
PerfMonitor::Instance()->max_timer_idle, PerfMonitor::Instance()->max_timer_idle,
@ -26,7 +27,8 @@ static void SavePerfLog()
PerfMonitor::Instance()->login_error_times, PerfMonitor::Instance()->login_error_times,
PlayerMgr::Instance()->OnlineNum(), PlayerMgr::Instance()->OnlineNum(),
PlayerMgr::Instance()->WatchPlayerNum(), PlayerMgr::Instance()->WatchPlayerNum(),
DBHelper::Instance()->cache_users_hash.size() DBHelper::Instance()->cache_users_hash.size(),
PerfMonitor::Instance()->send_ws_count
}); });
a8::UdpLog::Instance()->Info a8::UdpLog::Instance()->Info
("run_times:%d timer_times:%d event_times:%d free_times:%d " ("run_times:%d timer_times:%d event_times:%d free_times:%d "

View File

@ -16,6 +16,7 @@ class PerfMonitor : public a8::Singleton<PerfMonitor>
long long out_data_size = 0; long long out_data_size = 0;
long long in_data_size = 0; long long in_data_size = 0;
long long read_count = 0; long long read_count = 0;
long long send_ws_count = 0;
void Init(); void Init();
void UnInit(); void UnInit();