This commit is contained in:
aozhiwei 2019-05-29 21:04:02 +08:00
parent c902e2833d
commit e43f0aa759
6 changed files with 19 additions and 4 deletions

View File

@ -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(

View File

@ -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;
}

View File

@ -31,6 +31,7 @@ class GCListener : public a8::Singleton<GCListener>
void ForceCloseClient(unsigned short sockhandle);
void MarkClient(unsigned short sockhandle, bool is_active);
long long GetSendNodeNum();
private:
a8::TcpListener *tcp_listener_ = nullptr;

View File

@ -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)
{

View File

@ -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;

@ -1 +1 @@
Subproject commit 0ae4192e3a75e5627a80e5131fb4425948f146b6
Subproject commit c0baee99800e68e3e82c5902aae5ad4ce151493e