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
remove-scene-viewer
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

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

View File

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

View File

@ -86,6 +86,15 @@ namespace OpenSim.Region.Framework.Scenes
get { return lastReportedSimFPS; } 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 public float[] LastReportedSimStats
{ {
get { return lastReportedSimStats; } get { return lastReportedSimStats; }
@ -100,8 +109,17 @@ namespace OpenSim.Region.Framework.Scenes
private float lastReportedSimFPS = 0; private float lastReportedSimFPS = 0;
private float[] lastReportedSimStats = new float[21]; private float[] lastReportedSimStats = new float[21];
private float m_pfps = 0; private float m_pfps = 0;
/// <summary>
/// Number of agent updates requested in this stats cycle
/// </summary>
private int m_agentUpdates = 0; 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_frameMS = 0;
private int m_netMS = 0; private int m_netMS = 0;
private int m_agentMS = 0; private int m_agentMS = 0;
@ -291,6 +309,10 @@ namespace OpenSim.Region.Framework.Scenes
{ {
handlerSendStatResult(simStats); handlerSendStatResult(simStats);
} }
// Extra statistics that aren't currently sent to clients
LastReportedObjectUpdates = m_objectUpdates / statsUpdateFactor;
resetvalues(); resetvalues();
} }
} }
@ -301,6 +323,7 @@ namespace OpenSim.Region.Framework.Scenes
m_fps = 0; m_fps = 0;
m_pfps = 0; m_pfps = 0;
m_agentUpdates = 0; m_agentUpdates = 0;
m_objectUpdates = 0;
//m_inPacketsPerSecond = 0; //m_inPacketsPerSecond = 0;
//m_outPacketsPerSecond = 0; //m_outPacketsPerSecond = 0;
m_unAckedBytes = 0; m_unAckedBytes = 0;
@ -382,6 +405,11 @@ namespace OpenSim.Region.Framework.Scenes
m_pfps += frames; m_pfps += frames;
} }
public void AddObjectUpdates(int numUpdates)
{
m_objectUpdates += numUpdates;
}
public void AddAgentUpdates(int numUpdates) public void AddAgentUpdates(int numUpdates)
{ {
m_agentUpdates += numUpdates; m_agentUpdates += numUpdates;