You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
2.4 KiB

using Sog;
using Sog.Log;
using ProtoCSStruct;
namespace Friend
{
public class FriendServerStat
{
private static long m_lastLogTime;
public static void Tick(long nowMs)
{
//每秒记录一次一些信息
if (nowMs < m_lastLogTime + 60000)
{
return;
}
m_lastLogTime = nowMs;
WriteOnlinePlayerStat();
}
private static void WriteOnlinePlayerStat()
{
TraceLog.Stat("PlayerInfoFriend {0}", FriendServerUtils.GetPlayerTable().m_playerTable.Count);
TraceLog.Stat("FriendCacheInfoStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_cacheStructFriendInfo.GetTotalCount()
, FriendInfoCache.m_cacheStructFriendInfo.GetUsedCount()
, FriendInfoCache.m_cacheStructFriendInfo.GetUsedPercent());
TraceLog.Stat("DBFriendOneStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_cacheStructFriendOne.GetTotalCount()
, FriendInfoCache.m_cacheStructFriendOne.GetUsedCount()
, FriendInfoCache.m_cacheStructFriendOne.GetUsedPercent());
TraceLog.Stat("DBFriendOneOpStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_cacheStructFriendOneOp.GetTotalCount()
, FriendInfoCache.m_cacheStructFriendOneOp.GetUsedCount()
, FriendInfoCache.m_cacheStructFriendOneOp.GetUsedPercent());
TraceLog.Stat("DBFriendChatOneStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_cacheStructFriendChat.GetTotalCount()
, FriendInfoCache.m_cacheStructFriendChat.GetUsedCount()
, FriendInfoCache.m_cacheStructFriendChat.GetUsedPercent());
TraceLog.Stat("DBFriendStrangerOneStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_cacheStructFriendStranger.GetTotalCount()
, FriendInfoCache.m_cacheStructFriendStranger.GetUsedCount()
, FriendInfoCache.m_cacheStructFriendStranger.GetUsedPercent());
TraceLog.Stat("RemoteFriendOneStruct total {0} used {1} rate {2}%"
, FriendInfoCache.m_remoteFriendOneCache.GetTotalCount()
, FriendInfoCache.m_remoteFriendOneCache.GetUsedCount()
, FriendInfoCache.m_remoteFriendOneCache.GetUsedPercent());
}
}
}