Added show client-stats [first last] command to expose what viewers are requesting.

This commit is contained in:
Diva Canto
2013-07-10 16:09:45 -07:00
parent 38e6da5522
commit 1b265b213b
4 changed files with 143 additions and 18 deletions

View File

@@ -678,12 +678,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//there is a local handler for this packet type
if (pprocessor.Async)
{
ClientInfo cinfo = UDPClient.GetClientInfo();
if (!cinfo.AsyncRequests.ContainsKey(packet.Type.ToString()))
cinfo.AsyncRequests[packet.Type.ToString()] = 0;
cinfo.AsyncRequests[packet.Type.ToString()]++;
object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
Util.FireAndForget(ProcessSpecificPacketAsync, obj);
result = true;
}
else
{
ClientInfo cinfo = UDPClient.GetClientInfo();
if (!cinfo.SyncRequests.ContainsKey(packet.Type.ToString()))
cinfo.SyncRequests[packet.Type.ToString()] = 0;
cinfo.SyncRequests[packet.Type.ToString()]++;
result = pprocessor.method(this, packet);
}
}
@@ -698,6 +708,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
if (found)
{
ClientInfo cinfo = UDPClient.GetClientInfo();
if (!cinfo.GenericRequests.ContainsKey(packet.Type.ToString()))
cinfo.GenericRequests[packet.Type.ToString()] = 0;
cinfo.GenericRequests[packet.Type.ToString()]++;
result = method(this, packet);
}
}
@@ -12030,7 +12045,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ClientInfo info = m_udpClient.GetClientInfo();
info.proxyEP = null;
info.agentcircuit = RequestClientInfo();
if (info.agentcircuit == null)
info.agentcircuit = RequestClientInfo();
return info;
}

View File

@@ -159,6 +159,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private int m_defaultRTO = 1000; // 1sec is the recommendation in the RFC
private int m_maxRTO = 60000;
private ClientInfo m_info = new ClientInfo();
/// <summary>
/// Default constructor
/// </summary>
@@ -240,20 +242,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// TODO: This data structure is wrong in so many ways. Locking and copying the entire lists
// of pending and needed ACKs for every client every time some method wants information about
// this connection is a recipe for poor performance
ClientInfo info = new ClientInfo();
info.pendingAcks = new Dictionary<uint, uint>();
info.needAck = new Dictionary<uint, byte[]>();
info.resendThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate;
info.landThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate;
info.windThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate;
info.cloudThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate;
info.taskThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate;
info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate;
info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate;
info.totalThrottle = (int)m_throttleCategory.DripRate;
m_info.resendThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate;
m_info.landThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate;
m_info.windThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate;
m_info.cloudThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate;
m_info.taskThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate;
m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate;
m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate;
m_info.totalThrottle = (int)m_throttleCategory.DripRate;
return info;
return m_info;
}
/// <summary>