diff options
author | Justin Clark-Casey (justincc) | 2014-10-02 23:49:37 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:18:39 +0000 |
commit | 51eb8facd6734bbdc57718f4adf065af38e0a87d (patch) | |
tree | 43e45a341bf56d0e10c5e7ce9789b959bb010e62 | |
parent | minor: Remove compiler warnings from unused fields in TokenBucket (diff) | |
download | opensim-SC_OLD-51eb8facd6734bbdc57718f4adf065af38e0a87d.zip opensim-SC_OLD-51eb8facd6734bbdc57718f4adf065af38e0a87d.tar.gz opensim-SC_OLD-51eb8facd6734bbdc57718f4adf065af38e0a87d.tar.bz2 opensim-SC_OLD-51eb8facd6734bbdc57718f4adf065af38e0a87d.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 27 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 26 |
2 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index d8ca343..3f2a340 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -320,6 +320,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
320 | } | 320 | } |
321 | 321 | ||
322 | /// <summary> | 322 | /// <summary> |
323 | /// Get the total number of pakcets queued for this client. | ||
324 | /// </summary> | ||
325 | /// <returns></returns> | ||
326 | public int GetTotalPacketsQueuedCount() | ||
327 | { | ||
328 | int total = 0; | ||
329 | |||
330 | for (int i = 0; i <= (int)ThrottleOutPacketType.Asset; i++) | ||
331 | total += m_packetOutboxes[i].Count; | ||
332 | |||
333 | return total; | ||
334 | } | ||
335 | |||
336 | /// <summary> | ||
337 | /// Get the number of packets queued for the given throttle type. | ||
338 | /// </summary> | ||
339 | /// <returns></returns> | ||
340 | /// <param name="throttleType"></param> | ||
341 | public int GetPacketsQueuedCount(ThrottleOutPacketType throttleType) | ||
342 | { | ||
343 | if ((int)throttleType > 0) | ||
344 | return m_packetOutboxes[(int)throttleType].Count; | ||
345 | else | ||
346 | return 0; | ||
347 | } | ||
348 | |||
349 | /// <summary> | ||
323 | /// Return statistics information about client packet queues. | 350 | /// Return statistics information about client packet queues. |
324 | /// </summary> | 351 | /// </summary> |
325 | /// <remarks> | 352 | /// <remarks> |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index fc6fb3e..664e23e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -688,6 +688,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
688 | StatType.Pull, | 688 | StatType.Pull, |
689 | stat => stat.Value = PacketPool.Instance.BlocksPooled, | 689 | stat => stat.Value = PacketPool.Instance.BlocksPooled, |
690 | StatVerbosity.Debug)); | 690 | StatVerbosity.Debug)); |
691 | |||
692 | StatsManager.RegisterStat( | ||
693 | new Stat( | ||
694 | "OutgoingPacketsQueuedCount", | ||
695 | "Packets queued for outgoing send", | ||
696 | "Number of queued outgoing packets across all connections", | ||
697 | "", | ||
698 | "clientstack", | ||
699 | Scene.Name, | ||
700 | StatType.Pull, | ||
701 | MeasuresOfInterest.AverageChangeOverTime, | ||
702 | stat => stat.Value = GetTotalQueuedOutgoingPackets(), | ||
703 | StatVerbosity.Info)); | ||
691 | 704 | ||
692 | // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by | 705 | // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by |
693 | // scene name | 706 | // scene name |
@@ -703,6 +716,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
703 | return x == m_location; | 716 | return x == m_location; |
704 | } | 717 | } |
705 | 718 | ||
719 | public int GetTotalQueuedOutgoingPackets() | ||
720 | { | ||
721 | int total = 0; | ||
722 | |||
723 | foreach (ScenePresence sp in Scene.GetScenePresences()) | ||
724 | { | ||
725 | LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; | ||
726 | total += udpClient.GetTotalPacketsQueuedCount(); | ||
727 | } | ||
728 | |||
729 | return total; | ||
730 | } | ||
731 | |||
706 | // public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) | 732 | // public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) |
707 | // { | 733 | // { |
708 | // // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way | 734 | // // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way |