diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SimStatsReporter.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 742d42a..18e6ece 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -298,6 +298,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
298 | physfps = 0; | 298 | physfps = 0; |
299 | 299 | ||
300 | #endregion | 300 | #endregion |
301 | if (reportedFPS <= 0) | ||
302 | reportedFPS = 1; | ||
303 | |||
304 | float perframe = 1.0f / (float)reportedFPS; | ||
305 | |||
306 | float TotalFrameTime = m_frameMS * perframe; | ||
307 | |||
308 | float targetframetime = 1100.0f / (float)m_nominalReportedFps; | ||
309 | |||
310 | float sparetime; | ||
311 | if (TotalFrameTime > targetframetime) | ||
312 | { | ||
313 | sparetime = 0; | ||
314 | } | ||
301 | 315 | ||
302 | m_rootAgents = m_scene.SceneGraph.GetRootAgentCount(); | 316 | m_rootAgents = m_scene.SceneGraph.GetRootAgentCount(); |
303 | m_childAgents = m_scene.SceneGraph.GetChildAgentCount(); | 317 | m_childAgents = m_scene.SceneGraph.GetChildAgentCount(); |
@@ -309,15 +323,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
309 | // so that stat numbers are always consistent. | 323 | // so that stat numbers are always consistent. |
310 | CheckStatSanity(); | 324 | CheckStatSanity(); |
311 | 325 | ||
312 | //Our time dilation is 0.91 when we're running a full speed, | 326 | // other MS is actually simulation time |
313 | // therefore to make sure we get an appropriate range, | 327 | // m_otherMS = m_frameMS - m_physicsMS - m_imageMS - m_netMS - m_agentMS; |
314 | // we have to factor in our error. (0.10f * statsUpdateFactor) | 328 | // m_imageMS m_netMS are not included in m_frameMS |
315 | // multiplies the fix for the error times the amount of times it'll occur a second | 329 | |
316 | // / 10 divides the value by the number of times the sim heartbeat runs (10fps) | 330 | m_otherMS = m_frameMS - m_physicsMS - m_agentMS; |
317 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. | 331 | if (m_otherMS < 0) |
318 | 332 | m_otherMS = 0; | |
319 | // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change | ||
320 | // values to X-per-second values. | ||
321 | 333 | ||
322 | uint thisFrame = m_scene.Frame; | 334 | uint thisFrame = m_scene.Frame; |
323 | float framesUpdated = (float)(thisFrame - m_lastUpdateFrame) * m_reportedFpsCorrectionFactor; | 335 | float framesUpdated = (float)(thisFrame - m_lastUpdateFrame) * m_reportedFpsCorrectionFactor; |