From 3d5a7e9b194d9d6a73091935e316b56d5302dcbb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 31 Oct 2013 23:45:52 +0000 Subject: [PATCH] Add OutgoingPacketsResentCount clientstack stat. This allows one to monitor the total number of messages resent to clients over time. A constantly increasing stat may indicate a general server network or overloading issue if a fairly high proportion of packets sent A smaller constantly increasing stat may indicate a problem with a particular client-server connection, would need to check "show queues" in this case. --- .../ClientStack/Linden/UDP/LLClientView.cs | 6 ++++- .../ClientStack/Linden/UDP/LLUDPServer.cs | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 03cd2b49e6..5d3b5b556b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3801,7 +3801,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber); // Count this as a resent packet since we are going to requeue all of the updates contained in it - Interlocked.Increment(ref m_udpClient.PacketsResent); + Interlocked.Increment(ref m_udpClient.PacketsResent); + + // We're not going to worry about interlock yet since its not currently critical that this total count + // is 100% correct + m_udpServer.PacketsResentCount++; foreach (EntityUpdate update in updates) ResendPrimUpdate(update); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 218c2b2444..ca17771ac6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -145,6 +145,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP stat => stat.Value = m_udpServer.UdpSends, StatVerbosity.Debug)); + StatsManager.RegisterStat( + new Stat( + "OutgoingPacketsResentCount", + "Number of packets resent because a client did not acknowledge receipt", + "", + "", + "clientstack", + scene.Name, + StatType.Pull, + MeasuresOfInterest.AverageChangeOverTime, + stat => stat.Value = m_udpServer.PacketsResentCount, + StatVerbosity.Debug)); + StatsManager.RegisterStat( new Stat( "AverageUDPProcessTime", @@ -294,6 +307,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP public Socket Server { get { return null; } } + /// + /// Record how many packets have been resent + /// + internal int PacketsResentCount { get; set; } + + /// + /// Record how many packets have been sent + /// + internal int PacketsSentCount { get; set; } + /// /// Record how many inbound packets could not be recognized as LLUDP packets. /// @@ -1221,6 +1244,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Stats tracking Interlocked.Increment(ref udpClient.PacketsSent); + // We're not going to worry about interlock yet since its not currently critical that this total count + // is 100% correct + PacketsSentCount++; + // Put the UDP payload on the wire AsyncBeginSend(buffer);