完善master日志
This commit is contained in:
parent
7f9f34e67f
commit
67572ef05d
@ -105,6 +105,11 @@ Friend* CacheMgr::GetFriendData(const std::string& account_id)
|
|||||||
return itr != friend_hash_.end() ? itr->second : nullptr;
|
return itr != friend_hash_.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t CacheMgr::GetCacheFriendNum()
|
||||||
|
{
|
||||||
|
return friend_hash_.size();
|
||||||
|
}
|
||||||
|
|
||||||
void CacheMgr::RemoveTimeoutFriend()
|
void CacheMgr::RemoveTimeoutFriend()
|
||||||
{
|
{
|
||||||
if (friend_hash_.size() < 10000 * 50) {
|
if (friend_hash_.size() < 10000 * 50) {
|
||||||
|
@ -25,6 +25,7 @@ class CacheMgr : public a8::Singleton<CacheMgr>
|
|||||||
void _SS_IM_PullUserList(f8::MsgHdr& hdr, const ss::SS_IM_PullUserList& msg);
|
void _SS_IM_PullUserList(f8::MsgHdr& hdr, const ss::SS_IM_PullUserList& msg);
|
||||||
|
|
||||||
Friend* GetFriendData(const std::string& account_id);
|
Friend* GetFriendData(const std::string& account_id);
|
||||||
|
size_t GetCacheFriendNum();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void RemoveTimeoutFriend();
|
void RemoveTimeoutFriend();
|
||||||
|
@ -5,19 +5,28 @@
|
|||||||
|
|
||||||
#include "perfmonitor.h"
|
#include "perfmonitor.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
#include "cachemgr.h"
|
||||||
|
#include "svrmgr.h"
|
||||||
|
|
||||||
static void SavePerfLog()
|
static void SavePerfLog()
|
||||||
{
|
{
|
||||||
a8::UdpLog::Instance()->Info
|
a8::UdpLog::Instance()->Info
|
||||||
("max_run_delay_time:%d max_timer_idle:%d "
|
("max_run_delay_time:%d max_timer_idle:%d "
|
||||||
"in_data_size:%d out_data_size:%d msgnode_size:%d read_count:%d ",
|
"in_data_size:%d out_data_size:%d msgnode_size:%d read_count:%d "
|
||||||
|
"cache_friend_num:%d alloc_node_total_times:%d alloc_node_ok_times:%d "
|
||||||
|
"alloc_node_fail_times:%d node_num:%d " ,
|
||||||
{
|
{
|
||||||
PerfMonitor::Instance()->max_run_delay_time,
|
PerfMonitor::Instance()->max_run_delay_time,
|
||||||
PerfMonitor::Instance()->max_timer_idle,
|
PerfMonitor::Instance()->max_timer_idle,
|
||||||
PerfMonitor::Instance()->in_data_size,
|
PerfMonitor::Instance()->in_data_size,
|
||||||
PerfMonitor::Instance()->out_data_size,
|
PerfMonitor::Instance()->out_data_size,
|
||||||
App::Instance()->msgnode_size_,
|
App::Instance()->msgnode_size_,
|
||||||
PerfMonitor::Instance()->read_count
|
PerfMonitor::Instance()->read_count,
|
||||||
|
CacheMgr::Instance()->GetCacheFriendNum(),
|
||||||
|
PerfMonitor::Instance()->alloc_node_total_times,
|
||||||
|
PerfMonitor::Instance()->alloc_node_ok_times,
|
||||||
|
PerfMonitor::Instance()->alloc_node_fail_times,
|
||||||
|
SvrMgr::Instance()->GetNodeNum()
|
||||||
});
|
});
|
||||||
a8::UdpLog::Instance()->Info
|
a8::UdpLog::Instance()->Info
|
||||||
("run_times:%d timer_times:%d event_times:%d free_times:%d "
|
("run_times:%d timer_times:%d event_times:%d free_times:%d "
|
||||||
|
@ -13,6 +13,9 @@ class PerfMonitor : public a8::Singleton<PerfMonitor>
|
|||||||
long long out_data_size = 0;
|
long long out_data_size = 0;
|
||||||
long long in_data_size = 0;
|
long long in_data_size = 0;
|
||||||
long long read_count = 0;
|
long long read_count = 0;
|
||||||
|
long long alloc_node_total_times = 0;
|
||||||
|
long long alloc_node_ok_times = 0;
|
||||||
|
long long alloc_node_fail_times = 0;
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
@ -185,6 +185,11 @@ void SvrMgr::OnIMServerDisconnect(a8::XParams& param)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t SvrMgr::GetNodeNum()
|
||||||
|
{
|
||||||
|
return node_key_hash_.size();
|
||||||
|
}
|
||||||
|
|
||||||
SvrNode* SvrMgr::AllocNode(const std::string& account_id)
|
SvrNode* SvrMgr::AllocNode(const std::string& account_id)
|
||||||
{
|
{
|
||||||
Friend* friend_data = CacheMgr::Instance()->GetFriendData(account_id);
|
Friend* friend_data = CacheMgr::Instance()->GetFriendData(account_id);
|
||||||
|
@ -44,6 +44,7 @@ class SvrMgr : public a8::Singleton<SvrMgr>
|
|||||||
|
|
||||||
SvrNode* GetNodeBySocket(int socket_handle);
|
SvrNode* GetNodeBySocket(int socket_handle);
|
||||||
void OnIMServerDisconnect(a8::XParams& param);
|
void OnIMServerDisconnect(a8::XParams& param);
|
||||||
|
size_t GetNodeNum();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SvrNode* AllocNode(const std::string& account_id);
|
SvrNode* AllocNode(const std::string& account_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user