This commit is contained in:
aozhiwei 2019-08-30 11:32:25 +08:00
parent 7f4ae6bad2
commit cea6669913
2 changed files with 28 additions and 3 deletions

View File

@ -65,7 +65,7 @@ static void SavePerfLog()
f8::HttpClientPool::Instance()->GetPendingNum()
});
if (App::Instance()->HasFlag(4)) {
a8::XPrintf("mainloop_time:%d netmsg_time:%d room:%d over_room:%d online:%d bullet:%d grid_chg_times:%d test_times:%d ray_times:%d ray_time:%d send_node_num:%d sent_node_num:%d sent_bytes_num:%d\n",
a8::XPrintf("mainloop_time:%d netmsg_time:%d room:%d over_room:%d online:%d bullet:%d grid_chg_times:%d test_times:%d ray_times:%d ray_time:%d send_node_num:%d sent_node_num:%d sent_bytes_num:%d max_user_request_delay:%d\n",
{
App::Instance()->perf.max_run_delay_time,
App::Instance()->perf.max_dispatchmsg_time,
@ -79,7 +79,8 @@ static void SavePerfLog()
App::Instance()->perf.ray_time,
GGListener::Instance()->GetSendNodeNum(),
GGListener::Instance()->GetSentNodeNum(),
GGListener::Instance()->GetSentBytesNum()
GGListener::Instance()->GetSentBytesNum(),
f8::HttpClientPool::Instance()->max_user_request_delay
});
a8::XPrintf("params[0]:%d params[1]:%d params[2]:%d params[3]:%d params[4]:%d params[5]:%d params[6]:%d\n",
{
@ -110,6 +111,27 @@ static void SavePerfLog()
f8::HttpClientPool::Instance()->max_user_request_delay = 0;
}
static void HttpTest()
{
for (int i = 0; i < 70; ++i) {
a8::Timer::Instance()->AddRepeatTimer(100 + rand() % 1000,
a8::XParams(),
[] (const a8::XParams& param)
{
f8::HttpClientPool::Instance()->HttpGet(
a8::XParams(),
nullptr,
nullptr,
//"http://game2001-test.kingsome.cn/webapp/index.php?c=Ops&a=selfChecking",
"http://192.144.140.87:7101/webapp/index.php?c=Ops&a=selfChecking",
//("http://127.0.0.1:7112/webapp/index.php?c=Ops&a=selfChecking&time=" + a8::XValue(a8::XGetTickCount() + rand()).GetString()).c_str(),
a8::XObject(),
MAX_SYS_HTTP_NUM + (rand() % MAX_USER_HTTP_NUM)
);
});
}
}
bool App::Init(int argc, char* argv[])
{
signal(SIGPIPE, SIG_IGN);
@ -178,6 +200,9 @@ bool App::Init(int argc, char* argv[])
}
);
}
if (HasFlag(8)) {
HttpTest();
}
return true;
}

@ -1 +1 @@
Subproject commit 02b5137bf64407153ba11efbb670413930913690
Subproject commit dffa31103a8b58ffc7accfb8d9596d9d86c5d16d