1
This commit is contained in:
parent
1568015fee
commit
193d1454b9
@ -58,7 +58,15 @@ static void SavePerfLog()
|
||||
App::Instance()->perf.max_run_delay_time,
|
||||
RoomMgr::Instance()->RoomNum()
|
||||
});
|
||||
a8::XPrintf("max_mainloop_rundelay:%d max_dispatchmsg_time:%d room_num:%d player_num:%d\n",
|
||||
{
|
||||
App::Instance()->perf.max_run_delay_time,
|
||||
App::Instance()->perf.max_dispatchmsg_time,
|
||||
RoomMgr::Instance()->RoomNum(),
|
||||
PlayerMgr::Instance()->GetPlayerNum()
|
||||
});
|
||||
App::Instance()->perf.max_run_delay_time = 0;
|
||||
App::Instance()->perf.max_dispatchmsg_time = 0;
|
||||
App::Instance()->perf.max_timer_idle = 0;
|
||||
f8::HttpClientPool::Instance()->max_request_delay = 0;
|
||||
}
|
||||
@ -291,7 +299,9 @@ bool App::HasTask()
|
||||
|
||||
void App::DispatchMsg()
|
||||
{
|
||||
long long starttick = a8::XGetTickCount();
|
||||
#ifdef PERFT
|
||||
long long begin_tick = a8::XGetTickCount();
|
||||
#endif
|
||||
if (!work_node_ && top_node_) {
|
||||
msg_mutex_->lock();
|
||||
work_node_ = top_node_;
|
||||
@ -324,7 +334,7 @@ void App::DispatchMsg()
|
||||
}
|
||||
free(pdelnode);
|
||||
working_msgnode_size_--;
|
||||
if (a8::XGetTickCount() - starttick > 200) {
|
||||
if (a8::XGetTickCount() - begin_tick > 200) {
|
||||
break;
|
||||
}
|
||||
}//end while
|
||||
@ -332,6 +342,12 @@ void App::DispatchMsg()
|
||||
if (!work_node_) {
|
||||
working_msgnode_size_ = 0;
|
||||
}
|
||||
#ifdef PERFT
|
||||
a8::tick_t end_tick = a8::XGetTickCount();
|
||||
if (end_tick - begin_tick > perf.max_dispatchmsg_time) {
|
||||
perf.max_dispatchmsg_time = end_tick - begin_tick;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void App::ProcessGameGateMsg(f8::MsgHdr& hdr)
|
||||
|
@ -3,6 +3,7 @@
|
||||
struct PerfMonitor
|
||||
{
|
||||
int max_run_delay_time = 0;
|
||||
int max_dispatchmsg_time = 0;
|
||||
int max_timer_idle = 0;
|
||||
long long out_data_size = 0;
|
||||
long long in_data_size = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user