This commit is contained in:
aozhiwei 2021-09-22 08:57:59 +00:00
parent 17443b9bcf
commit cf5fb3c508
3 changed files with 23 additions and 3 deletions

View File

@ -20,6 +20,7 @@ public:
void UnInit();
int max_packet_size = 0;
int his_max_packet_size = 0;
template <typename T>
void SendProxyMsg(int sockhandle, T& msg)

View File

@ -65,8 +65,9 @@ static void SavePerfLog()
a8::UdpLog::Instance()->Info
("max_rundelay:%d room_num:%d player_num:%d online_num:%d alive_count:%d "
"sys_request_delay:%d user_request_delay:%d http_pending_num:%d real_alive_count:%d "
"account_num:%d level0_num:%d level1_num:%d max_full_obj:%d max_part_obj:%d max_bullet:%d "
"max_packet:%d",
"account_num:%d level0_num:%d level1_num:%d "
"max_full_obj:%d max_part_obj:%d max_bullet:%d max_packet:%d"
"his_max_full_obj:%d his_max_part_obj:%d his_max_bullet:%d his_max_packet:%d",
{
PerfMonitor::Instance()->max_run_delay_time,
RoomMgr::Instance()->RoomNum(),
@ -83,8 +84,22 @@ static void SavePerfLog()
PerfMonitor::Instance()->max_full_objects_num,
PerfMonitor::Instance()->max_part_objects_num,
PerfMonitor::Instance()->max_bullet_num,
GGListener::Instance()->max_packet_size
GGListener::Instance()->max_packet_size,
PerfMonitor::Instance()->his_max_full_objects_num,
PerfMonitor::Instance()->his_max_part_objects_num,
PerfMonitor::Instance()->his_max_bullet_num,
GGListener::Instance()->his_max_packet_size
});
{
PerfMonitor::Instance()->his_max_full_objects_num = std::max
(PerfMonitor::Instance()->his_max_full_objects_num, PerfMonitor::Instance()->max_full_objects_num);
PerfMonitor::Instance()->his_max_part_objects_num = std::max
(PerfMonitor::Instance()->his_max_part_objects_num, PerfMonitor::Instance()->max_part_objects_num);
PerfMonitor::Instance()->his_max_bullet_num = std::max
(PerfMonitor::Instance()->his_max_bullet_num, PerfMonitor::Instance()->max_bullet_num);
GGListener::Instance()->his_max_packet_size = std::max
(GGListener::Instance()->his_max_packet_size, GGListener::Instance()->max_packet_size);
}
PerfMonitor::Instance()->max_run_delay_time = 0;
PerfMonitor::Instance()->max_dispatchmsg_time = 0;
PerfMonitor::Instance()->max_timer_idle = 0;

View File

@ -24,6 +24,10 @@ class PerfMonitor : public a8::Singleton<PerfMonitor>
int max_part_objects_num = 0;
int max_bullet_num = 0;
int his_max_full_objects_num = 0;
int his_max_part_objects_num = 0;
int his_max_bullet_num = 0;
void Init();
void UnInit();
};