* Re-enable lightweight packet tracking stats on a 3000 ms interval.

mysql-performance
Teravus Ovares (Dan Olivares) 2009-11-27 19:17:36 -05:00
parent f84da8e642
commit 8296413add
2 changed files with 14 additions and 5 deletions

View File

@ -138,6 +138,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// whether or not to sleep</summary>
private bool m_packetSent;
/// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary>
private int m_elapsedMSSinceLastStatReport = 0;
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary>
private int m_tickLastOutgoingPacketHandler;
/// <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
// Start the packet processing threads
Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
m_elapsedMSSinceLastStatReport = Environment.TickCount;
}
public new void Stop()
@ -716,6 +719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// We don't need to do anything else with ping checks
StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
CompletePing(udpClient, startPing.PingID.PingID);
if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000)
{
udpClient.SendPacketStats();
m_elapsedMSSinceLastStatReport = Environment.TickCount;
}
return;
}
else if (packet.Type == PacketType.CompletePingCheck)

View File

@ -238,7 +238,7 @@ namespace OpenSim.Region.Framework.Scenes
sb[12].StatValue = m_otherMS / statsUpdateFactor;
sb[13].StatID = (uint)Stats.InPacketsPerSecond;
sb[13].StatValue = (m_inPacketsPerSecond);
sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor);
sb[14].StatID = (uint)Stats.OutPacketsPerSecond;
sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
@ -285,8 +285,8 @@ namespace OpenSim.Region.Framework.Scenes
m_fps = 0;
m_pfps = 0;
m_agentUpdates = 0;
m_inPacketsPerSecond = 0;
m_outPacketsPerSecond = 0;
//m_inPacketsPerSecond = 0;
//m_outPacketsPerSecond = 0;
m_unAckedBytes = 0;
m_scriptLinesPerSecond = 0;
@ -373,12 +373,12 @@ namespace OpenSim.Region.Framework.Scenes
public void AddInPackets(int numPackets)
{
m_inPacketsPerSecond += numPackets;
m_inPacketsPerSecond = numPackets;
}
public void AddOutPackets(int numPackets)
{
m_outPacketsPerSecond += numPackets;
m_outPacketsPerSecond = numPackets;
}
public void AddunAckedBytes(int numBytes)