Start recording object updates per second statistic (analogue of agent updates per secod) and expose via monitoring module as ObjectUpdatePerSecondMonitor

A useful diagnostic to find out how object updates are burdening a scene
This commit is contained in:
Justin Clark-Casey (justincc)
2011-10-11 22:17:05 +01:00
parent f138a2056e
commit fe3594c5ea
3 changed files with 43 additions and 1 deletions

View File

@@ -86,6 +86,15 @@ namespace OpenSim.Region.Framework.Scenes
get { return lastReportedSimFPS; }
}
/// <summary>
/// Number of object updates performed in the last stats cycle
/// </summary>
/// <remarks>
/// This isn't sent out to the client but it is very useful data to detect whether viewers are being sent a
/// large number of object updates.
/// </remarks>
public float LastReportedObjectUpdates { get; private set; }
public float[] LastReportedSimStats
{
get { return lastReportedSimStats; }
@@ -100,8 +109,17 @@ namespace OpenSim.Region.Framework.Scenes
private float lastReportedSimFPS = 0;
private float[] lastReportedSimStats = new float[21];
private float m_pfps = 0;
/// <summary>
/// Number of agent updates requested in this stats cycle
/// </summary>
private int m_agentUpdates = 0;
/// <summary>
/// Number of object updates requested in this stats cycle
/// </summary>
private int m_objectUpdates;
private int m_frameMS = 0;
private int m_netMS = 0;
private int m_agentMS = 0;
@@ -291,6 +309,10 @@ namespace OpenSim.Region.Framework.Scenes
{
handlerSendStatResult(simStats);
}
// Extra statistics that aren't currently sent to clients
LastReportedObjectUpdates = m_objectUpdates / statsUpdateFactor;
resetvalues();
}
}
@@ -301,6 +323,7 @@ namespace OpenSim.Region.Framework.Scenes
m_fps = 0;
m_pfps = 0;
m_agentUpdates = 0;
m_objectUpdates = 0;
//m_inPacketsPerSecond = 0;
//m_outPacketsPerSecond = 0;
m_unAckedBytes = 0;
@@ -382,6 +405,11 @@ namespace OpenSim.Region.Framework.Scenes
m_pfps += frames;
}
public void AddObjectUpdates(int numUpdates)
{
m_objectUpdates += numUpdates;
}
public void AddAgentUpdates(int numUpdates)
{
m_agentUpdates += numUpdates;