aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.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/PacketPool.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 '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs40
1 files changed, 34 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs b/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
index 2a3d14f..9f22fb4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
@@ -47,18 +47,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
47 private PercentageStat m_packetsReusedStat = new PercentageStat( 47 private PercentageStat m_packetsReusedStat = new PercentageStat(
48 "PacketsReused", 48 "PacketsReused",
49 "Packets reused", 49 "Packets reused",
50 "Number of packets reused out of all requests to the packet pool",
50 "clientstack", 51 "clientstack",
51 "packetpool", 52 "packetpool",
52 StatVerbosity.Debug, 53 StatType.Push,
53 "Number of packets reused out of all requests to the packet pool"); 54 null,
55 StatVerbosity.Debug);
54 56
55 private PercentageStat m_blocksReusedStat = new PercentageStat( 57 private PercentageStat m_blocksReusedStat = new PercentageStat(
56 "BlocksReused", 58 "PacketDataBlocksReused",
57 "Blocks reused", 59 "Packet data blocks reused",
60 "Number of data blocks reused out of all requests to the packet pool",
58 "clientstack", 61 "clientstack",
59 "packetpool", 62 "packetpool",
60 StatVerbosity.Debug, 63 StatType.Push,
61 "Number of data blocks reused out of all requests to the packet pool"); 64 null,
65 StatVerbosity.Debug);
62 66
63 /// <summary> 67 /// <summary>
64 /// Pool of packets available for reuse. 68 /// Pool of packets available for reuse.
@@ -88,6 +92,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 { 92 {
89 StatsManager.RegisterStat(m_packetsReusedStat); 93 StatsManager.RegisterStat(m_packetsReusedStat);
90 StatsManager.RegisterStat(m_blocksReusedStat); 94 StatsManager.RegisterStat(m_blocksReusedStat);
95
96 StatsManager.RegisterStat(
97 new Stat(
98 "PacketsPoolCount",
99 "Objects within the packet pool",
100 "The number of objects currently stored within the packet pool",
101 "",
102 "clientstack",
103 "packetpool",
104 StatType.Pull,
105 stat => { lock (pool) { stat.Value = pool.Count; } },
106 StatVerbosity.Debug));
107
108 StatsManager.RegisterStat(
109 new Stat(
110 "PacketDataBlocksPoolCount",
111 "Objects within the packet data block pool",
112 "The number of objects currently stored within the packet data block pool",
113 "",
114 "clientstack",
115 "packetpool",
116 StatType.Pull,
117 stat => { lock (DataBlocks) { stat.Value = DataBlocks.Count; } },
118 StatVerbosity.Debug));
91 } 119 }
92 120
93 /// <summary> 121 /// <summary>