diff options
author | Teravus Ovares (Dan Olivares) | 2009-11-27 19:17:36 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-11-27 19:17:36 -0500 |
commit | 8296413add95ce2a56f308fa7e762196155dd028 (patch) | |
tree | f0684a65d18e1b05d1a1c83d051aeec1d3fa6575 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://MyConnection/var/git/opensim (diff) | |
download | opensim-SC_OLD-8296413add95ce2a56f308fa7e762196155dd028.zip opensim-SC_OLD-8296413add95ce2a56f308fa7e762196155dd028.tar.gz opensim-SC_OLD-8296413add95ce2a56f308fa7e762196155dd028.tar.bz2 opensim-SC_OLD-8296413add95ce2a56f308fa7e762196155dd028.tar.xz |
* Re-enable lightweight packet tracking stats on a 3000 ms interval.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index c773c05..338f2bb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -138,6 +138,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
138 | /// whether or not to sleep</summary> | 138 | /// whether or not to sleep</summary> |
139 | private bool m_packetSent; | 139 | private bool m_packetSent; |
140 | 140 | ||
141 | /// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary> | ||
142 | private int m_elapsedMSSinceLastStatReport = 0; | ||
141 | /// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary> | 143 | /// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary> |
142 | private int m_tickLastOutgoingPacketHandler; | 144 | private int m_tickLastOutgoingPacketHandler; |
143 | /// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary> | 145 | /// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary> |
@@ -246,6 +248,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
246 | // Start the packet processing threads | 248 | // Start the packet processing threads |
247 | Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); | 249 | Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); |
248 | Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); | 250 | Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); |
251 | m_elapsedMSSinceLastStatReport = Environment.TickCount; | ||
249 | } | 252 | } |
250 | 253 | ||
251 | public new void Stop() | 254 | public new void Stop() |
@@ -716,6 +719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
716 | // We don't need to do anything else with ping checks | 719 | // We don't need to do anything else with ping checks |
717 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; | 720 | StartPingCheckPacket startPing = (StartPingCheckPacket)packet; |
718 | CompletePing(udpClient, startPing.PingID.PingID); | 721 | CompletePing(udpClient, startPing.PingID.PingID); |
722 | |||
723 | if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000) | ||
724 | { | ||
725 | udpClient.SendPacketStats(); | ||
726 | m_elapsedMSSinceLastStatReport = Environment.TickCount; | ||
727 | } | ||
719 | return; | 728 | return; |
720 | } | 729 | } |
721 | else if (packet.Type == PacketType.CompletePingCheck) | 730 | else if (packet.Type == PacketType.CompletePingCheck) |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 56c6ed6..3b5455f 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -238,7 +238,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
238 | sb[12].StatValue = m_otherMS / statsUpdateFactor; | 238 | sb[12].StatValue = m_otherMS / statsUpdateFactor; |
239 | 239 | ||
240 | sb[13].StatID = (uint)Stats.InPacketsPerSecond; | 240 | sb[13].StatID = (uint)Stats.InPacketsPerSecond; |
241 | sb[13].StatValue = (m_inPacketsPerSecond); | 241 | sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor); |
242 | 242 | ||
243 | sb[14].StatID = (uint)Stats.OutPacketsPerSecond; | 243 | sb[14].StatID = (uint)Stats.OutPacketsPerSecond; |
244 | sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); | 244 | sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); |
@@ -285,8 +285,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
285 | m_fps = 0; | 285 | m_fps = 0; |
286 | m_pfps = 0; | 286 | m_pfps = 0; |
287 | m_agentUpdates = 0; | 287 | m_agentUpdates = 0; |
288 | m_inPacketsPerSecond = 0; | 288 | //m_inPacketsPerSecond = 0; |
289 | m_outPacketsPerSecond = 0; | 289 | //m_outPacketsPerSecond = 0; |
290 | m_unAckedBytes = 0; | 290 | m_unAckedBytes = 0; |
291 | m_scriptLinesPerSecond = 0; | 291 | m_scriptLinesPerSecond = 0; |
292 | 292 | ||
@@ -373,12 +373,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
373 | 373 | ||
374 | public void AddInPackets(int numPackets) | 374 | public void AddInPackets(int numPackets) |
375 | { | 375 | { |
376 | m_inPacketsPerSecond += numPackets; | 376 | m_inPacketsPerSecond = numPackets; |
377 | } | 377 | } |
378 | 378 | ||
379 | public void AddOutPackets(int numPackets) | 379 | public void AddOutPackets(int numPackets) |
380 | { | 380 | { |
381 | m_outPacketsPerSecond += numPackets; | 381 | m_outPacketsPerSecond = numPackets; |
382 | } | 382 | } |
383 | 383 | ||
384 | public void AddunAckedBytes(int numBytes) | 384 | public void AddunAckedBytes(int numBytes) |