aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-23 01:50:05 +0100
committerJustin Clark-Casey (justincc)2012-10-23 01:52:10 +0100
commit4578ff74fec7500902f58fbdee6ce5a6b39601fb (patch)
tree5058ada18085a83ae8a76a791ba1052c7025b6d6 /OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
parentminor: Get content type handler logger to log "unset" for the content type in... (diff)
downloadopensim-SC_OLD-4578ff74fec7500902f58fbdee6ce5a6b39601fb.zip
opensim-SC_OLD-4578ff74fec7500902f58fbdee6ce5a6b39601fb.tar.gz
opensim-SC_OLD-4578ff74fec7500902f58fbdee6ce5a6b39601fb.tar.bz2
opensim-SC_OLD-4578ff74fec7500902f58fbdee6ce5a6b39601fb.tar.xz
Add object count stats for new IncomingPacket and UDPPacketBuffer pools if they are enabled. Add count stats for existing LLUDP pool.
This introduces a pull stat type in addition to the push stat type. A pull stat takes a method on construction which knows how to update the stat on request. In this way, special interfaces for pull stat collection are not necessary.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index 6e6b3ef..18abfd6 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -31,6 +31,7 @@ using System.Net.Sockets;
31using System.Threading; 31using System.Threading;
32using log4net; 32using log4net;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Monitoring;
34 35
35namespace OpenMetaverse 36namespace OpenMetaverse
36{ 37{
@@ -107,9 +108,25 @@ namespace OpenMetaverse
107 public void StartInbound(int recvBufferSize, bool asyncPacketHandling) 108 public void StartInbound(int recvBufferSize, bool asyncPacketHandling)
108 { 109 {
109 if (UsePools) 110 if (UsePools)
111 {
110 m_pool = new Pool<UDPPacketBuffer>(() => new UDPPacketBuffer(), 500); 112 m_pool = new Pool<UDPPacketBuffer>(() => new UDPPacketBuffer(), 500);
113
114 StatsManager.RegisterStat(
115 new Stat(
116 "UDPPacketBufferPoolCount",
117 "Objects within the UDPPacketBuffer pool",
118 "The number of objects currently stored within the UDPPacketBuffer pool",
119 "",
120 "clientstack",
121 "packetpool",
122 StatType.Pull,
123 stat => stat.Value = m_pool.Count,
124 StatVerbosity.Debug));
125 }
111 else 126 else
127 {
112 m_pool = null; 128 m_pool = null;
129 }
113 130
114 m_asyncPacketHandling = asyncPacketHandling; 131 m_asyncPacketHandling = asyncPacketHandling;
115 132