aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs12
2 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 63ac5f6..8707737 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
158 /// One can tweak this number to experiment. One current effect of reducing it is to make avatar animations 158 /// One can tweak this number to experiment. One current effect of reducing it is to make avatar animations
159 /// occur too quickly (viewer 1) or with even more slide (viewer 2). 159 /// occur too quickly (viewer 1) or with even more slide (viewer 2).
160 /// </remarks> 160 /// </remarks>
161 protected float m_minFrameTimespan = 0.089f; 161 public float MinFrameTime { get; private set; }
162 162
163 /// <summary> 163 /// <summary>
164 /// The time of the last frame update. 164 /// The time of the last frame update.
@@ -552,6 +552,7 @@ namespace OpenSim.Region.Framework.Scenes
552 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) 552 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
553 { 553 {
554 m_config = config; 554 m_config = config;
555 MinFrameTime = 0.089f;
555 556
556 Random random = new Random(); 557 Random random = new Random();
557 558
@@ -1293,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes
1293 if (Frame % m_update_physics == 0) 1294 if (Frame % m_update_physics == 0)
1294 { 1295 {
1295 if (m_physics_enabled) 1296 if (m_physics_enabled)
1296 physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_minFrameTimespan)); 1297 physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, MinFrameTime));
1297 if (SynchronizeScene != null) 1298 if (SynchronizeScene != null)
1298 SynchronizeScene(this); 1299 SynchronizeScene(this);
1299 } 1300 }
@@ -1421,7 +1422,7 @@ namespace OpenSim.Region.Framework.Scenes
1421 } 1422 }
1422 1423
1423 maintc = Util.EnvironmentTickCountSubtract(maintc); 1424 maintc = Util.EnvironmentTickCountSubtract(maintc);
1424 maintc = (int)(m_minFrameTimespan * 1000) - maintc; 1425 maintc = (int)(MinFrameTime * 1000) - maintc;
1425 1426
1426 1427
1427 m_lastUpdate = Util.EnvironmentTickCount(); 1428 m_lastUpdate = Util.EnvironmentTickCount();
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 8d62b16..35cd025 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -107,6 +107,11 @@ namespace OpenSim.Region.Framework.Scenes
107 private int m_fps = 0; 107 private int m_fps = 0;
108 108
109 /// <summary> 109 /// <summary>
110 /// Our nominal fps target, as expected in fps stats when a sim is running normally.
111 /// </summary>
112 private float m_nominalReportedFps = 55;
113
114 /// <summary>
110 /// Parameter to adjust reported scene fps 115 /// Parameter to adjust reported scene fps
111 /// </summary> 116 /// </summary>
112 /// <remarks> 117 /// <remarks>
@@ -114,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
114 /// However, we will still report an FPS that's closer to what people are used to seeing. A lower FPS might 119 /// However, we will still report an FPS that's closer to what people are used to seeing. A lower FPS might
115 /// affect clients and monitoring scripts/software. 120 /// affect clients and monitoring scripts/software.
116 /// </remarks> 121 /// </remarks>
117 private float m_fpsCorrectionFactor = 5; 122 private float m_reportedFpsCorrectionFactor = 5;
118 123
119 // saved last reported value so there is something available for llGetRegionFPS 124 // saved last reported value so there is something available for llGetRegionFPS
120 private float lastReportedSimFPS = 0; 125 private float lastReportedSimFPS = 0;
@@ -165,8 +170,9 @@ namespace OpenSim.Region.Framework.Scenes
165 170
166 public SimStatsReporter(Scene scene) 171 public SimStatsReporter(Scene scene)
167 { 172 {
168 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000);
169 m_scene = scene; 173 m_scene = scene;
174 m_reportedFpsCorrectionFactor = scene.MinFrameTime * m_nominalReportedFps;
175 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000);
170 ReportingRegion = scene.RegionInfo; 176 ReportingRegion = scene.RegionInfo;
171 177
172 m_objectCapacity = scene.RegionInfo.ObjectCapacity; 178 m_objectCapacity = scene.RegionInfo.ObjectCapacity;
@@ -212,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
212 218
213 // We're going to lie about the FPS because we've been lying since 2008. The actual FPS is currently 219 // We're going to lie about the FPS because we've been lying since 2008. The actual FPS is currently
214 // locked at a maximum of 11. Maybe at some point this can change so that we're not lying. 220 // locked at a maximum of 11. Maybe at some point this can change so that we're not lying.
215 int reportedFPS = (int)(m_fps * m_fpsCorrectionFactor); 221 int reportedFPS = (int)(m_fps * m_reportedFpsCorrectionFactor);
216 222
217 // save the reported value so there is something available for llGetRegionFPS 223 // save the reported value so there is something available for llGetRegionFPS
218 lastReportedSimFPS = reportedFPS / statsUpdateFactor; 224 lastReportedSimFPS = reportedFPS / statsUpdateFactor;