From 3d5a7e9b194d9d6a73091935e316b56d5302dcbb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 31 Oct 2013 23:45:52 +0000
Subject: 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.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 6 ++++-
.../Region/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 03cd2b4..5d3b5b5 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 218c2b2..ca17771 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -147,6 +147,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
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",
"Average number of milliseconds taken to process each incoming UDP packet in a sample.",
"This is for initial receive processing which is separate from the later client LL packet processing stage.",
@@ -295,6 +308,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.
///
public int IncomingMalformedPacketCount { get; private set; }
@@ -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);
--
cgit v1.1