aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-21 01:27:09 +0000
committerJustin Clark-Casey (justincc)2012-03-21 01:27:09 +0000
commitde53aa32e0af4a14f6a0d0f27817b41e7befa62e (patch)
tree0bb9c8abb16377faca2bce05acfe973912e40850 /OpenSim/Region
parentIncorporate scene teleporting debugging into "debug scene teleport true|false... (diff)
downloadopensim-SC-de53aa32e0af4a14f6a0d0f27817b41e7befa62e.zip
opensim-SC-de53aa32e0af4a14f6a0d0f27817b41e7befa62e.tar.gz
opensim-SC-de53aa32e0af4a14f6a0d0f27817b41e7befa62e.tar.bz2
opensim-SC-de53aa32e0af4a14f6a0d0f27817b41e7befa62e.tar.xz
Add Scene.DebugUpdates switch which, if turned on, will print out a warning when a frame updates takes longer than twice the desired time
This is controlled via "debug scene updates true|false" on the region console. Also fix an oversight with "debug scene teleport true|false"
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs42
1 files changed, 32 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e1e4ed5..92c1060 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -65,8 +65,17 @@ namespace OpenSim.Region.Framework.Scenes
65 #region Fields 65 #region Fields
66 66
67 public bool EmergencyMonitoring = false; 67 public bool EmergencyMonitoring = false;
68
69 /// <summary>
70 /// Show debug information about teleports.
71 /// </summary>
68 public bool DebugTeleporting { get; private set; } 72 public bool DebugTeleporting { get; private set; }
69 73
74 /// <summary>
75 /// Show debug information about the scene loop.
76 /// </summary>
77 public bool DebugUpdates { get; private set; }
78
70 public SynchronizeSceneHandler SynchronizeScene; 79 public SynchronizeSceneHandler SynchronizeScene;
71 public SimStatsReporter StatsReporter; 80 public SimStatsReporter StatsReporter;
72 public List<Border> NorthBorders = new List<Border>(); 81 public List<Border> NorthBorders = new List<Border>();
@@ -1060,13 +1069,24 @@ namespace OpenSim.Region.Framework.Scenes
1060 1069
1061 if (options.ContainsKey("physics")) 1070 if (options.ContainsKey("physics"))
1062 { 1071 {
1063 bool enablePhysics = false; 1072 bool enablePhysics;
1064 if (bool.TryParse(options["physics"], out enablePhysics) && m_physics_enabled != enablePhysics) 1073 if (bool.TryParse(options["physics"], out enablePhysics))
1065 m_physics_enabled = enablePhysics; 1074 m_physics_enabled = enablePhysics;
1066 } 1075 }
1067 1076
1068 if (options.ContainsKey("teleport")) 1077 if (options.ContainsKey("teleport"))
1069 DebugTeleporting = true; 1078 {
1079 bool enableTeleportDebugging;
1080 if (bool.TryParse(options["teleport"], out enableTeleportDebugging))
1081 DebugTeleporting = enableTeleportDebugging;
1082 }
1083
1084 if (options.ContainsKey("updates"))
1085 {
1086 bool enableUpdateDebugging;
1087 if (bool.TryParse(options["updates"], out enableUpdateDebugging))
1088 DebugUpdates = enableUpdateDebugging;
1089 }
1070 } 1090 }
1071 1091
1072 public int GetInaccurateNeighborCount() 1092 public int GetInaccurateNeighborCount()
@@ -1390,7 +1410,7 @@ namespace OpenSim.Region.Framework.Scenes
1390 // Tell the watchdog that this thread is still alive 1410 // Tell the watchdog that this thread is still alive
1391 Watchdog.UpdateThread(); 1411 Watchdog.UpdateThread();
1392 1412
1393// previousFrameTick = m_lastFrameTick; 1413 previousFrameTick = m_lastFrameTick;
1394 m_lastFrameTick = Util.EnvironmentTickCount(); 1414 m_lastFrameTick = Util.EnvironmentTickCount();
1395 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); 1415 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
1396 maintc = (int)(MinFrameTime * 1000) - maintc; 1416 maintc = (int)(MinFrameTime * 1000) - maintc;
@@ -1399,12 +1419,14 @@ namespace OpenSim.Region.Framework.Scenes
1399 Thread.Sleep(maintc); 1419 Thread.Sleep(maintc);
1400 1420
1401 // Optionally warn if a frame takes double the amount of time that it should. 1421 // Optionally warn if a frame takes double the amount of time that it should.
1402// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) 1422 if (DebugUpdates
1403// m_log.WarnFormat( 1423 && Util.EnvironmentTickCountSubtract(
1404// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", 1424 m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2))
1405// Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), 1425 m_log.WarnFormat(
1406// MinFrameTime * 1000, 1426 "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}",
1407// RegionInfo.RegionName); 1427 Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick),
1428 MinFrameTime * 1000,
1429 RegionInfo.RegionName);
1408 } 1430 }
1409 } 1431 }
1410 1432