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
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-10-11 22:17:05 +01:00
parent 58f2c9e224
commit 4c9226be7b
3 changed files with 43 additions and 1 deletions

View File

@ -200,6 +200,14 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
m => m.Scene.StatsReporter.LastReportedSimStats[3],
m => string.Format("{0} per second", m.GetValue())));
m_monitors.Add(
new GenericMonitor(
m_scene,
"ObjectUpdatesPerSecondMonitor",
"Object Updates",
m => m.Scene.StatsReporter.LastReportedObjectUpdates,
m => string.Format("{0} per second", m.GetValue())));
m_monitors.Add(
new GenericMonitor(
m_scene,

View File

@ -3018,6 +3018,7 @@ namespace OpenSim.Region.Framework.Scenes
//isattachment = ParentGroup.RootPart.IsAttachment;
remoteClient.SendPrimUpdate(this, PrimUpdateFlags.FullUpdate);
ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
}
/// <summary>
@ -4796,7 +4797,12 @@ namespace OpenSim.Region.Framework.Scenes
// Causes this thread to dig into the Client Thread Data.
// Remember your locking here!
remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
remoteClient.SendPrimUpdate(
this,
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
}
public void AddScriptLPS(int count)

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;