From 8e1bf55e7b85f8c92237ef2208a4a2c31ba6153c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 6 Nov 2013 01:02:20 +0000 Subject: [PATCH] Add IncomingPacketsResentCount clientstack statistics This records how many packets were indicated to be resends by clients Not 100% reliable since clients can lie about resends, but usually would indicate if clients are not receiving UDP acks at all or in a manner they consider timely. --- .../ClientStack/Linden/UDP/LLUDPServer.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 3bd1ef164e..c0a4e56cea 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -132,6 +132,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP stat => stat.Value = m_udpServer.IncomingOrphanedPacketCount, StatVerbosity.Info)); + StatsManager.RegisterStat( + new Stat( + "IncomingPacketsResentCount", + "Number of inbound packets that clients indicate are resends.", + "", + "", + "clientstack", + scene.Name, + StatType.Pull, + MeasuresOfInterest.AverageChangeOverTime, + stat => stat.Value = m_udpServer.IncomingPacketsResentCount, + StatVerbosity.Debug)); + StatsManager.RegisterStat( new Stat( "OutgoingUDPSendsCount", @@ -317,6 +330,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// internal int PacketsSentCount { get; set; } + /// + /// Record how many incoming packets are indicated as resends by clients. + /// + internal int IncomingPacketsResentCount { get; set; } + /// /// Record how many inbound packets could not be recognized as LLUDP packets. /// @@ -1467,6 +1485,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Incoming Packet Accounting + // We're not going to worry about interlock yet since its not currently critical that this total count + // is 100% correct + if (packet.Header.Resent) + IncomingPacketsResentCount++; + // Check the archive of received reliable packet IDs to see whether we already received this packet if (packet.Header.Reliable && !udpClient.PacketArchive.TryEnqueue(packet.Header.Sequence)) {