From cea66699135160b08df44ed3cc61fd54bafb37e9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 30 Aug 2019 11:32:25 +0800 Subject: [PATCH] 1 --- server/gameserver/app.cc | 29 +++++++++++++++++++++++++++-- third_party/a8engine | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 328bf38..5f1669a 100755 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -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; } diff --git a/third_party/a8engine b/third_party/a8engine index 02b5137..dffa311 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit 02b5137bf64407153ba11efbb670413930913690 +Subproject commit dffa31103a8b58ffc7accfb8d9596d9d86c5d16d