mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Implements new 'Monitoring' system for reporting performance.
* Mostly the same set as the StatsMonitor used for Viewer notification, but exposes some new frametimes - including EventMS, PhysicsUpdateMS, LandUpdateMS; new memory monitoring - both GC.TotalMemory and Process.PrivateWorkingMemory64; also exposes ThreadCount (using System.Diagnostics.Process) * Type 'monitor report' on the console to see output. * SNMP Implementation forthcoming.
This commit is contained in:
@@ -274,6 +274,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private int physicsMS2;
|
||||
private int physicsMS;
|
||||
private int otherMS;
|
||||
private int tempOnRezMS;
|
||||
private int eventMS;
|
||||
private int backupMS;
|
||||
private int terrainMS;
|
||||
private int landMS;
|
||||
|
||||
public int MonitorFrameTime { get { return frameMS; } }
|
||||
public int MonitorPhysicsUpdateTime { get { return physicsMS; } }
|
||||
public int MonitorPhysicsSyncTime { get { return physicsMS2; } }
|
||||
public int MonitorOtherTime { get { return otherMS; } }
|
||||
public int MonitorTempOnRezTime { get { return tempOnRezMS; } }
|
||||
public int MonitorEventTime { get { return eventMS; } } // This may need to be divided into each event?
|
||||
public int MonitorBackupTime { get { return backupMS; } }
|
||||
public int MonitorTerrainTime { get { return terrainMS; } }
|
||||
public int MonitorLandTime { get { return landMS; } }
|
||||
|
||||
private bool m_physics_enabled = true;
|
||||
private bool m_scripts_enabled = true;
|
||||
@@ -1026,7 +1041,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate;
|
||||
physicsFPS = 0f;
|
||||
|
||||
maintc = maintc = frameMS = otherMS = Environment.TickCount;
|
||||
maintc = maintc = otherMS = Environment.TickCount;
|
||||
int tmpFrameMS = maintc;
|
||||
|
||||
// Increment the frame counter
|
||||
++m_frame;
|
||||
@@ -1046,15 +1062,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_frame % m_update_presences == 0)
|
||||
m_sceneGraph.UpdatePresences();
|
||||
|
||||
physicsMS2 = Environment.TickCount;
|
||||
int TempPhysicsMS2 = Environment.TickCount;
|
||||
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
|
||||
m_sceneGraph.UpdatePreparePhysics();
|
||||
physicsMS2 = Environment.TickCount - physicsMS2;
|
||||
TempPhysicsMS2 = Environment.TickCount - TempPhysicsMS2;
|
||||
physicsMS2 = TempPhysicsMS2;
|
||||
|
||||
if (m_frame % m_update_entitymovement == 0)
|
||||
m_sceneGraph.UpdateScenePresenceMovement();
|
||||
|
||||
physicsMS = Environment.TickCount;
|
||||
int TempPhysicsMS = Environment.TickCount;
|
||||
if (m_frame % m_update_physics == 0)
|
||||
{
|
||||
if (m_physics_enabled)
|
||||
@@ -1062,30 +1079,56 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (SynchronizeScene != null)
|
||||
SynchronizeScene(this);
|
||||
}
|
||||
physicsMS = Environment.TickCount - physicsMS;
|
||||
physicsMS += physicsMS2;
|
||||
TempPhysicsMS = Environment.TickCount - TempPhysicsMS;
|
||||
physicsMS = TempPhysicsMS;
|
||||
|
||||
// Delete temp-on-rez stuff
|
||||
if (m_frame % m_update_backup == 0)
|
||||
{
|
||||
int tozMS = Environment.TickCount;
|
||||
CleanTempObjects();
|
||||
tozMS -= Environment.TickCount;
|
||||
tempOnRezMS = tozMS;
|
||||
}
|
||||
|
||||
if (RegionStatus != RegionStatus.SlaveScene)
|
||||
{
|
||||
if (m_frame % m_update_events == 0)
|
||||
{
|
||||
int evMS = Environment.TickCount;
|
||||
UpdateEvents();
|
||||
evMS -= Environment.TickCount;
|
||||
eventMS = evMS;
|
||||
}
|
||||
|
||||
if (m_frame % m_update_backup == 0)
|
||||
{
|
||||
int backMS = Environment.TickCount;
|
||||
UpdateStorageBackup();
|
||||
backMS -= Environment.TickCount;
|
||||
backupMS = backMS;
|
||||
}
|
||||
|
||||
if (m_frame % m_update_terrain == 0)
|
||||
{
|
||||
int terMS = Environment.TickCount;
|
||||
UpdateTerrain();
|
||||
terMS -= Environment.TickCount;
|
||||
terrainMS = terMS;
|
||||
}
|
||||
|
||||
if (m_frame % m_update_land == 0)
|
||||
{
|
||||
int ldMS = Environment.TickCount;
|
||||
UpdateLand();
|
||||
ldMS -= Environment.TickCount;
|
||||
landMS = ldMS;
|
||||
}
|
||||
|
||||
int tickCount = Environment.TickCount;
|
||||
otherMS = tickCount - otherMS;
|
||||
frameMS = tickCount - frameMS;
|
||||
tmpFrameMS -= tickCount;
|
||||
frameMS = tmpFrameMS;
|
||||
|
||||
// if (m_frame%m_update_avatars == 0)
|
||||
// UpdateInWorldTime();
|
||||
@@ -1097,7 +1140,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
|
||||
StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
|
||||
StatsReporter.addFrameMS(frameMS);
|
||||
StatsReporter.addPhysicsMS(physicsMS);
|
||||
StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
|
||||
StatsReporter.addOtherMS(otherMS);
|
||||
StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
|
||||
StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS());
|
||||
|
||||
Reference in New Issue
Block a user