diff --git a/server/wsproxy/CMakeLists.txt b/server/wsproxy/CMakeLists.txt index 77ac129..456f7c8 100644 --- a/server/wsproxy/CMakeLists.txt +++ b/server/wsproxy/CMakeLists.txt @@ -16,8 +16,8 @@ else() endif() set(CMAKE_BUILD_TYPE "Debug") -set(CMAKE_CXX_FLAGS_RELEASE "-std=gnu++11 -fsanitize=address -fno-omit-frame-pointer") -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11") +set(CMAKE_BUILD_TYPE "Release") +set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1") set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1") include_directories( diff --git a/server/wsproxy/GCListener.cc b/server/wsproxy/GCListener.cc index 78a866c..9dd3d4f 100644 --- a/server/wsproxy/GCListener.cc +++ b/server/wsproxy/GCListener.cc @@ -137,3 +137,8 @@ void GCListener::MarkClient(unsigned short sockhandle, bool is_active) { tcp_listener_->MarkClient(sockhandle, is_active); } + +long long GCListener::GetSendNodeNum() +{ + return tcp_listener_->send_node_num; +} diff --git a/server/wsproxy/GCListener.h b/server/wsproxy/GCListener.h index 6ad5d28..eaef725 100644 --- a/server/wsproxy/GCListener.h +++ b/server/wsproxy/GCListener.h @@ -31,6 +31,7 @@ class GCListener : public a8::Singleton void ForceCloseClient(unsigned short sockhandle); void MarkClient(unsigned short sockhandle, bool is_active); + long long GetSendNodeNum(); private: a8::TcpListener *tcp_listener_ = nullptr; diff --git a/server/wsproxy/app.cc b/server/wsproxy/app.cc index 9f81651..9a48ea3 100644 --- a/server/wsproxy/app.cc +++ b/server/wsproxy/app.cc @@ -63,6 +63,14 @@ static void SavePerfLog() App::Instance()->msgnode_size_, App::Instance()->perf.read_count, }); + if (App::Instance()->HasFlag(2)) { + a8::XPrintf("mainloop_time:%d netmsg_time:%d send_node_num:%d\n", + { + App::Instance()->perf.max_run_delay_time, + App::Instance()->perf.max_dispatchmsg_time, + GCListener::Instance()->GetSendNodeNum() + }); + } #if 1 App::Instance()->perf.max_run_delay_time = 0; App::Instance()->perf.max_timer_idle = 0; @@ -115,7 +123,7 @@ bool App::Init(int argc, char* argv[]) } if (HasFlag(1)) { a8::Timer::Instance()->AddDeadLineTimer( - 1000 * 10, + 1000 * 60, a8::XParams(), [] (const a8::XParams& param) { diff --git a/server/wsproxy/types.h b/server/wsproxy/types.h index 1467ba7..d976a26 100644 --- a/server/wsproxy/types.h +++ b/server/wsproxy/types.h @@ -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; diff --git a/third_party/a8engine b/third_party/a8engine index 0ae4192..c0baee9 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit 0ae4192e3a75e5627a80e5131fb4425948f146b6 +Subproject commit c0baee99800e68e3e82c5902aae5ad4ce151493e