From 2c36106675ad984ba5af674cbb970b17ffa320bb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 15 Nov 2012 01:14:18 +0000
Subject: Add IncomingPacketsProcessedCount stat for diagnostics.
Also puts some packet processing counts in a container named after the scene so that stats can be collected from more than one scene.
---
.../ClientStack/Linden/UDP/OpenSimUDPBase.cs | 31 +++++-----------------
1 file changed, 7 insertions(+), 24 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index 85cbb06..808d177 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -61,14 +61,14 @@ namespace OpenMetaverse
private bool m_asyncPacketHandling;
///
- /// Pool to use for handling data. May be null if UsePools = false;
+ /// Are we to use object pool(s) to reduce memory churn when receiving data?
///
- protected OpenSim.Framework.Pool m_pool;
+ public bool UsePools { get; protected set; }
///
- /// Are we to use object pool(s) to reduce memory churn when receiving data?
+ /// Pool to use for handling data. May be null if UsePools = false;
///
- public bool UsePools { get; protected set; }
+ protected OpenSim.Framework.Pool Pool { get; private set; }
/// Returns true if the server is currently listening for inbound packets, otherwise false
public bool IsRunningInbound { get; private set; }
@@ -77,8 +77,6 @@ namespace OpenMetaverse
/// If IsRunningOut = false, then any request to send a packet is simply dropped.
public bool IsRunningOutbound { get; private set; }
- private Stat m_poolCountStat;
-
///
/// Default constructor
///
@@ -182,21 +180,7 @@ namespace OpenMetaverse
{
if (!UsePools)
{
- m_pool = new Pool(() => new UDPPacketBuffer(), 500);
-
- m_poolCountStat
- = new Stat(
- "UDPPacketBufferPoolCount",
- "Objects within the UDPPacketBuffer pool",
- "The number of objects currently stored within the UDPPacketBuffer pool",
- "",
- "clientstack",
- "packetpool",
- StatType.Pull,
- stat => stat.Value = m_pool.Count,
- StatVerbosity.Debug);
-
- StatsManager.RegisterStat(m_poolCountStat);
+ Pool = new Pool(() => new UDPPacketBuffer(), 500);
UsePools = true;
@@ -211,7 +195,6 @@ namespace OpenMetaverse
if (UsePools)
{
UsePools = false;
- StatsManager.DeregisterStat(m_poolCountStat);
// We won't null out the pool to avoid a race condition with code that may be in the middle of using it.
@@ -226,7 +209,7 @@ namespace OpenMetaverse
UDPPacketBuffer buf;
if (UsePools)
- buf = m_pool.GetObject();
+ buf = Pool.GetObject();
else
buf = new UDPPacketBuffer();
@@ -309,7 +292,7 @@ namespace OpenMetaverse
finally
{
if (UsePools)
- m_pool.ReturnObject(buffer);
+ Pool.ReturnObject(buffer);
// Synchronous mode waits until the packet callback completes
// before starting the receive to fetch another packet
--
cgit v1.1
From 038528dc80e0fe03956d61872ba30a887b2890a1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 15 Nov 2012 02:02:59 +0000
Subject: Make PacketPool class stats pull stats instead of push stats so they
can be lifted up into LLUDPServer and be distiguished by scene name
---
OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index 808d177..3f7ca2b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -334,4 +334,4 @@ namespace OpenMetaverse
catch (ObjectDisposedException) { }
}
}
-}
+}
\ No newline at end of file
--
cgit v1.1