diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 05af942..f501828 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -225,7 +225,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
225 | private int backupMS; | 225 | private int backupMS; |
226 | private int terrainMS; | 226 | private int terrainMS; |
227 | private int landMS; | 227 | private int landMS; |
228 | private int spareMS; | ||
229 | 228 | ||
230 | /// <summary> | 229 | /// <summary> |
231 | /// Tick at which the last frame was processed. | 230 | /// Tick at which the last frame was processed. |
@@ -1434,16 +1433,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1434 | endFrame = Frame + frames; | 1433 | endFrame = Frame + frames; |
1435 | 1434 | ||
1436 | float physicsFPS = 0f; | 1435 | float physicsFPS = 0f; |
1437 | int previousFrameTick, tmpMS; | 1436 | int tmpMS; |
1438 | int maintc = Util.EnvironmentTickCount(); | 1437 | int previousFrameTick; |
1438 | int maintc; | ||
1439 | int sleepMS; | ||
1440 | int framestart; | ||
1439 | 1441 | ||
1440 | while (!m_shuttingDown && (endFrame == null || Frame < endFrame)) | 1442 | while (!m_shuttingDown && (endFrame == null || Frame < endFrame)) |
1441 | { | 1443 | { |
1444 | framestart = Util.EnvironmentTickCount(); | ||
1442 | ++Frame; | 1445 | ++Frame; |
1443 | 1446 | ||
1444 | // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); | 1447 | // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); |
1445 | 1448 | ||
1446 | agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0; | 1449 | agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; |
1447 | 1450 | ||
1448 | try | 1451 | try |
1449 | { | 1452 | { |
@@ -1495,6 +1498,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1495 | m_sceneGraph.UpdatePresences(); | 1498 | m_sceneGraph.UpdatePresences(); |
1496 | 1499 | ||
1497 | agentMS += Util.EnvironmentTickCountSubtract(tmpMS); | 1500 | agentMS += Util.EnvironmentTickCountSubtract(tmpMS); |
1501 | |||
1498 | 1502 | ||
1499 | // Delete temp-on-rez stuff | 1503 | // Delete temp-on-rez stuff |
1500 | if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) | 1504 | if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) |
@@ -1573,36 +1577,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
1573 | 1577 | ||
1574 | Watchdog.UpdateThread(); | 1578 | Watchdog.UpdateThread(); |
1575 | 1579 | ||
1580 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; | ||
1581 | |||
1582 | StatsReporter.AddPhysicsFPS(physicsFPS); | ||
1583 | StatsReporter.AddTimeDilation(TimeDilation); | ||
1584 | StatsReporter.AddFPS(1); | ||
1585 | |||
1586 | StatsReporter.addAgentMS(agentMS); | ||
1587 | StatsReporter.addPhysicsMS(physicsMS + physicsMS2); | ||
1588 | StatsReporter.addOtherMS(otherMS); | ||
1589 | StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); | ||
1590 | |||
1576 | previousFrameTick = m_lastFrameTick; | 1591 | previousFrameTick = m_lastFrameTick; |
1577 | m_lastFrameTick = Util.EnvironmentTickCount(); | 1592 | m_lastFrameTick = Util.EnvironmentTickCount(); |
1578 | tmpMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); | 1593 | tmpMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick, framestart); |
1579 | tmpMS = (int)(MinFrameTime * 1000) - tmpMS; | 1594 | tmpMS = (int)(MinFrameTime * 1000) - tmpMS; |
1580 | 1595 | ||
1581 | m_firstHeartbeat = false; | 1596 | m_firstHeartbeat = false; |
1582 | 1597 | ||
1598 | sleepMS = Util.EnvironmentTickCount(); | ||
1599 | |||
1583 | if (tmpMS > 0) | 1600 | if (tmpMS > 0) |
1584 | { | ||
1585 | Thread.Sleep(tmpMS); | 1601 | Thread.Sleep(tmpMS); |
1586 | spareMS += tmpMS; | ||
1587 | } | ||
1588 | 1602 | ||
1589 | frameMS = Util.EnvironmentTickCountSubtract(maintc); | 1603 | sleepMS = Util.EnvironmentTickCountSubtract(sleepMS); |
1590 | maintc = Util.EnvironmentTickCount(); | 1604 | frameMS = Util.EnvironmentTickCountSubtract(framestart); |
1591 | 1605 | StatsReporter.addSleepMS(sleepMS); | |
1592 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; | 1606 | StatsReporter.addFrameMS(frameMS); |
1593 | 1607 | ||
1594 | // if (Frame%m_update_avatars == 0) | 1608 | // if (Frame%m_update_avatars == 0) |
1595 | // UpdateInWorldTime(); | 1609 | // UpdateInWorldTime(); |
1596 | StatsReporter.AddPhysicsFPS(physicsFPS); | ||
1597 | StatsReporter.AddTimeDilation(TimeDilation); | ||
1598 | StatsReporter.AddFPS(1); | ||
1599 | 1610 | ||
1600 | StatsReporter.addFrameMS(frameMS); | ||
1601 | StatsReporter.addAgentMS(agentMS); | ||
1602 | StatsReporter.addPhysicsMS(physicsMS + physicsMS2); | ||
1603 | StatsReporter.addOtherMS(otherMS); | ||
1604 | StatsReporter.AddSpareMS(spareMS); | ||
1605 | StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); | ||
1606 | 1611 | ||
1607 | // Optionally warn if a frame takes double the amount of time that it should. | 1612 | // Optionally warn if a frame takes double the amount of time that it should. |
1608 | if (DebugUpdates | 1613 | if (DebugUpdates |