1
This commit is contained in:
parent
86a709acbf
commit
9f7276a776
@ -193,3 +193,8 @@ bool GCListener::GetWebSocketUrl(int socket_handle, std::string& url, std::strin
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int GCListener::GetSocketCount()
|
||||
{
|
||||
return tcp_listener_->GetClientSocketCount();
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ class GCListener : public a8::Singleton<GCListener>
|
||||
long long GetSendNodeNum();
|
||||
long long GetSentBytesNum();
|
||||
bool GetWebSocketUrl(int socket_handle, std::string& url, std::string& query_str);
|
||||
int GetSocketCount();
|
||||
|
||||
private:
|
||||
a8::TcpListener *tcp_listener_ = nullptr;
|
||||
|
@ -55,10 +55,10 @@ const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log";
|
||||
|
||||
static void SavePerfLog()
|
||||
{
|
||||
f8::UdpLog::Instance()->Info(" max_run_delay_time:%d max_timer_idle:%d "
|
||||
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",
|
||||
"max_join_time:%d tcp_count:%d udp_count:%d",
|
||||
{
|
||||
App::Instance()->GetPerf().max_run_delay_time,
|
||||
App::Instance()->GetPerf().max_timer_idle,
|
||||
@ -69,6 +69,8 @@ static void SavePerfLog()
|
||||
App::Instance()->GetPerf().read_count,
|
||||
App::Instance()->GetPerf().max_login_time,
|
||||
App::Instance()->GetPerf().max_join_time,
|
||||
GCListener::Instance()->GetSocketCount(),
|
||||
LongSessionMgr::Instance()->GetLongSessionCount()
|
||||
});
|
||||
if (App::Instance()->HasFlag(2)) {
|
||||
a8::XPrintf("mainloop_time:%d netmsg_time:%d send_node_num:%d sent_bytes_num:%d\n",
|
||||
|
@ -126,3 +126,8 @@ void LongSessionMgr::DelSession(int socket_handle)
|
||||
}
|
||||
socket_handle_hash_.erase(socket_handle);
|
||||
}
|
||||
|
||||
int LongSessionMgr::GetLongSessionCount()
|
||||
{
|
||||
return socket_handle_hash_.size();
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ class LongSessionMgr : public a8::Singleton<LongSessionMgr>
|
||||
std::shared_ptr<LongSession> GetSession(int socket_handle);
|
||||
std::shared_ptr<a8::UdpListener> GetUdpListener() { return udp_listener_; }
|
||||
void DelSession(int socket_handle);
|
||||
int GetLongSessionCount();
|
||||
|
||||
private:
|
||||
std::shared_ptr<a8::UdpListener> udp_listener_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user