diff options
author | Melanie | 2012-03-20 23:59:49 +0000 |
---|---|---|
committer | Melanie | 2012-03-20 23:59:49 +0000 |
commit | 80a3b43e691f89fb3a8b2757e1dfb9cf397fa7e4 (patch) | |
tree | 0c18c94dd0370b89f1581d9e4b5e329a02791c76 /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Add ability to log warn if a frame takes longer than twice the expected time.... (diff) | |
download | opensim-SC_OLD-80a3b43e691f89fb3a8b2757e1dfb9cf397fa7e4.zip opensim-SC_OLD-80a3b43e691f89fb3a8b2757e1dfb9cf397fa7e4.tar.gz opensim-SC_OLD-80a3b43e691f89fb3a8b2757e1dfb9cf397fa7e4.tar.bz2 opensim-SC_OLD-80a3b43e691f89fb3a8b2757e1dfb9cf397fa7e4.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2a511e4..f9b89fb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -193,7 +193,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | private int backupMS; | 193 | private int backupMS; |
194 | private int terrainMS; | 194 | private int terrainMS; |
195 | private int landMS; | 195 | private int landMS; |
196 | private int lastCompletedFrame; | 196 | |
197 | /// <summary> | ||
198 | /// Tick at which the last frame was processed. | ||
199 | /// </summary> | ||
200 | private int m_lastFrameTick; | ||
197 | 201 | ||
198 | public bool CombineRegions = false; | 202 | public bool CombineRegions = false; |
199 | /// <summary> | 203 | /// <summary> |
@@ -484,7 +488,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
484 | public int MonitorBackupTime { get { return backupMS; } } | 488 | public int MonitorBackupTime { get { return backupMS; } } |
485 | public int MonitorTerrainTime { get { return terrainMS; } } | 489 | public int MonitorTerrainTime { get { return terrainMS; } } |
486 | public int MonitorLandTime { get { return landMS; } } | 490 | public int MonitorLandTime { get { return landMS; } } |
487 | public int MonitorLastFrameTick { get { return lastCompletedFrame; } } | 491 | public int MonitorLastFrameTick { get { return m_lastFrameTick; } } |
488 | 492 | ||
489 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } | 493 | public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } |
490 | public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } | 494 | public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } |
@@ -1250,6 +1254,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1250 | 1254 | ||
1251 | float physicsFPS = 0f; | 1255 | float physicsFPS = 0f; |
1252 | int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS; | 1256 | int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS; |
1257 | int previousFrameTick; | ||
1253 | int maintc; | 1258 | int maintc; |
1254 | List<Vector3> coarseLocations; | 1259 | List<Vector3> coarseLocations; |
1255 | List<UUID> avatarUUIDs; | 1260 | List<UUID> avatarUUIDs; |
@@ -1353,10 +1358,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1353 | // UpdateLand(); | 1358 | // UpdateLand(); |
1354 | // landMS = Util.EnvironmentTickCountSubtract(ldMS); | 1359 | // landMS = Util.EnvironmentTickCountSubtract(ldMS); |
1355 | //} | 1360 | //} |
1356 | 1361 | ||
1357 | frameMS = Util.EnvironmentTickCountSubtract(maintc); | 1362 | frameMS = Util.EnvironmentTickCountSubtract(maintc); |
1358 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; | 1363 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; |
1359 | lastCompletedFrame = Util.EnvironmentTickCount(); | ||
1360 | 1364 | ||
1361 | // if (Frame%m_update_avatars == 0) | 1365 | // if (Frame%m_update_avatars == 0) |
1362 | // UpdateInWorldTime(); | 1366 | // UpdateInWorldTime(); |
@@ -1426,7 +1430,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1426 | // Tell the watchdog that this thread is still alive | 1430 | // Tell the watchdog that this thread is still alive |
1427 | Watchdog.UpdateThread(); | 1431 | Watchdog.UpdateThread(); |
1428 | 1432 | ||
1429 | maintc = Util.EnvironmentTickCountSubtract(maintc); | 1433 | // previousFrameTick = m_lastFrameTick; |
1434 | m_lastFrameTick = Util.EnvironmentTickCount(); | ||
1435 | maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); | ||
1430 | maintc = (int)(MinFrameTime * 1000) - maintc; | 1436 | maintc = (int)(MinFrameTime * 1000) - maintc; |
1431 | 1437 | ||
1432 | m_lastUpdate = Util.EnvironmentTickCount(); | 1438 | m_lastUpdate = Util.EnvironmentTickCount(); |
@@ -1435,10 +1441,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1435 | if (maintc > 0) | 1441 | if (maintc > 0) |
1436 | Thread.Sleep(maintc); | 1442 | Thread.Sleep(maintc); |
1437 | 1443 | ||
1438 | // if (frameMS > (int)(MinFrameTime * 1000)) | 1444 | // Optionally warn if a frame takes double the amount of time that it should. |
1445 | // if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) | ||
1439 | // m_log.WarnFormat( | 1446 | // m_log.WarnFormat( |
1440 | // "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", | 1447 | // "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", |
1441 | // frameMS, | 1448 | // Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), |
1442 | // MinFrameTime * 1000, | 1449 | // MinFrameTime * 1000, |
1443 | // RegionInfo.RegionName); | 1450 | // RegionInfo.RegionName); |
1444 | } | 1451 | } |