* Re-enable lightweight packet tracking stats on a 3000 ms interval.
parent
f84da8e642
commit
8296413add
|
@ -138,6 +138,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// whether or not to sleep</summary>
|
/// whether or not to sleep</summary>
|
||||||
private bool m_packetSent;
|
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>
|
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary>
|
||||||
private int m_tickLastOutgoingPacketHandler;
|
private int m_tickLastOutgoingPacketHandler;
|
||||||
/// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary>
|
/// <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
|
// Start the packet processing threads
|
||||||
Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
|
Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
|
||||||
Watchdog.StartThread(OutgoingPacketHandler, "Outgoing 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()
|
public new void Stop()
|
||||||
|
@ -716,6 +719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
// We don't need to do anything else with ping checks
|
// We don't need to do anything else with ping checks
|
||||||
StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
|
StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
|
||||||
CompletePing(udpClient, startPing.PingID.PingID);
|
CompletePing(udpClient, startPing.PingID.PingID);
|
||||||
|
|
||||||
|
if ((Environment.TickCount - m_elapsedMSSinceLastStatReport) >= 3000)
|
||||||
|
{
|
||||||
|
udpClient.SendPacketStats();
|
||||||
|
m_elapsedMSSinceLastStatReport = Environment.TickCount;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (packet.Type == PacketType.CompletePingCheck)
|
else if (packet.Type == PacketType.CompletePingCheck)
|
||||||
|
|
|
@ -238,7 +238,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
sb[12].StatValue = m_otherMS / statsUpdateFactor;
|
sb[12].StatValue = m_otherMS / statsUpdateFactor;
|
||||||
|
|
||||||
sb[13].StatID = (uint)Stats.InPacketsPerSecond;
|
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].StatID = (uint)Stats.OutPacketsPerSecond;
|
||||||
sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
|
sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
|
||||||
|
@ -285,8 +285,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_fps = 0;
|
m_fps = 0;
|
||||||
m_pfps = 0;
|
m_pfps = 0;
|
||||||
m_agentUpdates = 0;
|
m_agentUpdates = 0;
|
||||||
m_inPacketsPerSecond = 0;
|
//m_inPacketsPerSecond = 0;
|
||||||
m_outPacketsPerSecond = 0;
|
//m_outPacketsPerSecond = 0;
|
||||||
m_unAckedBytes = 0;
|
m_unAckedBytes = 0;
|
||||||
m_scriptLinesPerSecond = 0;
|
m_scriptLinesPerSecond = 0;
|
||||||
|
|
||||||
|
@ -373,12 +373,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void AddInPackets(int numPackets)
|
public void AddInPackets(int numPackets)
|
||||||
{
|
{
|
||||||
m_inPacketsPerSecond += numPackets;
|
m_inPacketsPerSecond = numPackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddOutPackets(int numPackets)
|
public void AddOutPackets(int numPackets)
|
||||||
{
|
{
|
||||||
m_outPacketsPerSecond += numPackets;
|
m_outPacketsPerSecond = numPackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddunAckedBytes(int numBytes)
|
public void AddunAckedBytes(int numBytes)
|
||||||
|
|
Loading…
Reference in New Issue