From 9fb8c7c51a6133769a1f14e9bd52e8d8e8221433 Mon Sep 17 00:00:00 2001 From: azw Date: Wed, 26 Apr 2023 06:58:30 +0000 Subject: [PATCH] 1 --- server/wsproxy/app.cc | 5 +++-- server/wsproxy/downstreammgr.cc | 5 +++++ server/wsproxy/downstreammgr.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/server/wsproxy/app.cc b/server/wsproxy/app.cc index 6b47615..431ae8d 100644 --- a/server/wsproxy/app.cc +++ b/server/wsproxy/app.cc @@ -58,7 +58,7 @@ static void SavePerfLog() f8::UdpLog::Instance()->Info("max_run_delay_time:%d max_timer_idle:%d " "in_data_size:%d out_data_size:%d msgnode_size:%d udp_msgnode_size:%d " "read_count:%d max_login_time:%d " - "max_join_time:%d tcp_count:%d udp_count:%d", + "max_join_time:%d tcp_count:%d udp_count:%d down_stream_count:%d", { App::Instance()->GetPerf().max_run_delay_time, App::Instance()->GetPerf().max_timer_idle, @@ -70,7 +70,8 @@ static void SavePerfLog() App::Instance()->GetPerf().max_login_time, App::Instance()->GetPerf().max_join_time, GCListener::Instance()->GetSocketCount(), - LongSessionMgr::Instance()->GetLongSessionCount() + LongSessionMgr::Instance()->GetLongSessionCount(), + DownStreamMgr::Instance()->GetDownStreamCount() }); if (App::Instance()->HasFlag(2)) { a8::XPrintf("mainloop_time:%d netmsg_time:%d send_node_num:%d sent_bytes_num:%d\n", diff --git a/server/wsproxy/downstreammgr.cc b/server/wsproxy/downstreammgr.cc index 531acc7..ef99152 100644 --- a/server/wsproxy/downstreammgr.cc +++ b/server/wsproxy/downstreammgr.cc @@ -152,3 +152,8 @@ void DownStreamMgr::RemovePendingAccount(int socket_handle) pending_account_hash_.erase(itr); } } + +int DownStreamMgr::GetDownStreamCount() +{ + return socket_hash_.size(); +} diff --git a/server/wsproxy/downstreammgr.h b/server/wsproxy/downstreammgr.h index 55dd8dc..09c8dcd 100644 --- a/server/wsproxy/downstreammgr.h +++ b/server/wsproxy/downstreammgr.h @@ -20,6 +20,7 @@ class DownStreamMgr : public a8::Singleton std::weak_ptr GetDownStream(int sockhande); void BindUpStream(int socket_handle, int instance_id); void AddPendingAccount(const std::string& account_id, int socket_handle, long long req_tick); + int GetDownStreamCount(); private: