diff options
author | Justin Clark-Casey (justincc) | 2012-10-23 01:50:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-23 01:52:10 +0100 |
commit | 4578ff74fec7500902f58fbdee6ce5a6b39601fb (patch) | |
tree | 5058ada18085a83ae8a76a791ba1052c7025b6d6 /OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | |
parent | minor: Get content type handler logger to log "unset" for the content type in... (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 17 |
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; | |||
31 | using System.Threading; | 31 | using System.Threading; |
32 | using log4net; | 32 | using log4net; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Monitoring; | ||
34 | 35 | ||
35 | namespace OpenMetaverse | 36 | namespace 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 | ||