aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-21 00:02:08 +0000
committerJustin Clark-Casey (justincc)2012-03-21 00:02:08 +0000
commit7bf628ab31028ac2118e43fbb9b9d0a77ea0f55f (patch)
tree3f1c68d96c21d754259357e42b38f70c86623593
parentAdd prim name to "[MESH]: No recognized physics mesh..." log message (diff)
downloadopensim-SC_OLD-7bf628ab31028ac2118e43fbb9b9d0a77ea0f55f.zip
opensim-SC_OLD-7bf628ab31028ac2118e43fbb9b9d0a77ea0f55f.tar.gz
opensim-SC_OLD-7bf628ab31028ac2118e43fbb9b9d0a77ea0f55f.tar.bz2
opensim-SC_OLD-7bf628ab31028ac2118e43fbb9b9d0a77ea0f55f.tar.xz
Add ability to log warn if a frame takes longer than twice the expected time. Currently commented out.
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1bea14f..790ec63 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -190,7 +190,11 @@ namespace OpenSim.Region.Framework.Scenes
190 private int backupMS; 190 private int backupMS;
191 private int terrainMS; 191 private int terrainMS;
192 private int landMS; 192 private int landMS;
193 private int lastCompletedFrame; 193
194 /// <summary>
195 /// Tick at which the last frame was processed.
196 /// </summary>
197 private int m_lastFrameTick;
194 198
195 /// <summary> 199 /// <summary>
196 /// Signals whether temporary objects are currently being cleaned up. Needed because this is launched 200 /// Signals whether temporary objects are currently being cleaned up. Needed because this is launched
@@ -464,7 +468,7 @@ namespace OpenSim.Region.Framework.Scenes
464 public int MonitorBackupTime { get { return backupMS; } } 468 public int MonitorBackupTime { get { return backupMS; } }
465 public int MonitorTerrainTime { get { return terrainMS; } } 469 public int MonitorTerrainTime { get { return terrainMS; } }
466 public int MonitorLandTime { get { return landMS; } } 470 public int MonitorLandTime { get { return landMS; } }
467 public int MonitorLastFrameTick { get { return lastCompletedFrame; } } 471 public int MonitorLastFrameTick { get { return m_lastFrameTick; } }
468 472
469 public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } 473 public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } }
470 public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } 474 public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } }
@@ -1202,6 +1206,7 @@ namespace OpenSim.Region.Framework.Scenes
1202 1206
1203 float physicsFPS = 0f; 1207 float physicsFPS = 0f;
1204 int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS; 1208 int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS;
1209 int previousFrameTick;
1205 int maintc; 1210 int maintc;
1206 List<Vector3> coarseLocations; 1211 List<Vector3> coarseLocations;
1207 List<UUID> avatarUUIDs; 1212 List<UUID> avatarUUIDs;
@@ -1305,10 +1310,9 @@ namespace OpenSim.Region.Framework.Scenes
1305 // UpdateLand(); 1310 // UpdateLand();
1306 // landMS = Util.EnvironmentTickCountSubtract(ldMS); 1311 // landMS = Util.EnvironmentTickCountSubtract(ldMS);
1307 //} 1312 //}
1308 1313
1309 frameMS = Util.EnvironmentTickCountSubtract(maintc); 1314 frameMS = Util.EnvironmentTickCountSubtract(maintc);
1310 otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; 1315 otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
1311 lastCompletedFrame = Util.EnvironmentTickCount();
1312 1316
1313 // if (Frame%m_update_avatars == 0) 1317 // if (Frame%m_update_avatars == 0)
1314 // UpdateInWorldTime(); 1318 // UpdateInWorldTime();
@@ -1378,16 +1382,19 @@ namespace OpenSim.Region.Framework.Scenes
1378 // Tell the watchdog that this thread is still alive 1382 // Tell the watchdog that this thread is still alive
1379 Watchdog.UpdateThread(); 1383 Watchdog.UpdateThread();
1380 1384
1381 maintc = Util.EnvironmentTickCountSubtract(maintc); 1385// previousFrameTick = m_lastFrameTick;
1386 m_lastFrameTick = Util.EnvironmentTickCount();
1387 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
1382 maintc = (int)(MinFrameTime * 1000) - maintc; 1388 maintc = (int)(MinFrameTime * 1000) - maintc;
1383 1389
1384 if (maintc > 0) 1390 if (maintc > 0)
1385 Thread.Sleep(maintc); 1391 Thread.Sleep(maintc);
1386 1392
1387// if (frameMS > (int)(MinFrameTime * 1000)) 1393 // Optionally warn if a frame takes double the amount of time that it should.
1394// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2))
1388// m_log.WarnFormat( 1395// m_log.WarnFormat(
1389// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", 1396// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}",
1390// frameMS, 1397// Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick),
1391// MinFrameTime * 1000, 1398// MinFrameTime * 1000,
1392// RegionInfo.RegionName); 1399// RegionInfo.RegionName);
1393 } 1400 }