From 60732c96efd149bbb0484b327b00463dc5b81aff Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 23 Jul 2013 00:15:58 +0100
Subject: Add clientstack.OutgoingUDPSendsCount stat to show number of outbound
UDP packets sent by a region per second
---
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 18 +++++++++++++++---
.../Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 7 +++++++
2 files changed, 22 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ClientStack')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 5300b1e..cc4de10 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -70,8 +70,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
StatsManager.RegisterStat(
new Stat(
"IncomingUDPReceivesCount",
- "Number of inbound LL protocol packets processed",
- "Number of inbound LL protocol packets processed",
+ "Number of UDP receives performed",
+ "Number of UDP receives performed",
"",
"clientstack",
scene.Name,
@@ -95,6 +95,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
StatsManager.RegisterStat(
new Stat(
+ "OutgoingUDPSendsCount",
+ "Number of UDP sends performed",
+ "Number of UDP sends performed",
+ "",
+ "clientstack",
+ scene.Name,
+ StatType.Pull,
+ MeasuresOfInterest.AverageChangeOverTime,
+ stat => stat.Value = m_udpServer.UdpSends,
+ 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.",
@@ -856,7 +869,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PacketPool.Instance.ReturnPacket(packet);
m_dataPresentEvent.Set();
-
}
private AutoResetEvent m_dataPresentEvent = new AutoResetEvent(false);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index b4044b5..d0ed7e8 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -83,6 +83,11 @@ namespace OpenMetaverse
public int UdpReceives { get; private set; }
///
+ /// Number of UDP sends
+ ///
+ public int UdpSends { get; private set; }
+
+ ///
/// Number of receives over which to establish a receive time average.
///
private readonly static int s_receiveTimeSamples = 500;
@@ -381,6 +386,8 @@ namespace OpenMetaverse
{
// UDPPacketBuffer buf = (UDPPacketBuffer)result.AsyncState;
m_udpSocket.EndSendTo(result);
+
+ UdpSends++;
}
catch (SocketException) { }
catch (ObjectDisposedException) { }
--
cgit v1.1