mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Add OutgoingPacketsQueuedCount clientstack stat.
This is the total of queued outgoing packets across all connections, as also seen in the "show queues" command. Gives some early indication of whether the simulator can't send all outgoing packets fast enough. Though then one would want to check that this isn't due to a few bad client connections.
This commit is contained in:
@@ -688,6 +688,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
StatType.Pull,
|
||||
stat => stat.Value = PacketPool.Instance.BlocksPooled,
|
||||
StatVerbosity.Debug));
|
||||
|
||||
StatsManager.RegisterStat(
|
||||
new Stat(
|
||||
"OutgoingPacketsQueuedCount",
|
||||
"Packets queued for outgoing send",
|
||||
"Number of queued outgoing packets across all connections",
|
||||
"",
|
||||
"clientstack",
|
||||
Scene.Name,
|
||||
StatType.Pull,
|
||||
MeasuresOfInterest.AverageChangeOverTime,
|
||||
stat => stat.Value = GetTotalQueuedOutgoingPackets(),
|
||||
StatVerbosity.Info));
|
||||
|
||||
// We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by
|
||||
// scene name
|
||||
@@ -703,6 +716,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return x == m_location;
|
||||
}
|
||||
|
||||
public int GetTotalQueuedOutgoingPackets()
|
||||
{
|
||||
int total = 0;
|
||||
|
||||
foreach (ScenePresence sp in Scene.GetScenePresences())
|
||||
{
|
||||
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
|
||||
total += udpClient.GetTotalPacketsQueuedCount();
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
// public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting)
|
||||
// {
|
||||
// // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way
|
||||
|
||||
Reference in New Issue
Block a user