aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs29
-rw-r--r--bin/OpenSimDefaults.ini10
2 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 32b45ac..2fcb78d 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -39,6 +39,7 @@ using Nini.Config;
39using OpenMetaverse; 39using OpenMetaverse;
40using OpenMetaverse.Packets; 40using OpenMetaverse.Packets;
41using OpenMetaverse.Imaging; 41using OpenMetaverse.Imaging;
42using OpenMetaverse.StructuredData;
42using OpenSim.Framework; 43using OpenSim.Framework;
43using OpenSim.Framework.Monitoring; 44using OpenSim.Framework.Monitoring;
44using OpenSim.Services.Interfaces; 45using OpenSim.Services.Interfaces;
@@ -360,6 +361,8 @@ namespace OpenSim.Region.Framework.Scenes
360 /// Frame time 361 /// Frame time
361 /// </remarks> 362 /// </remarks>
362 public float FrameTime { get; private set; } 363 public float FrameTime { get; private set; }
364 public int FrameTimeWarnPercent { get; private set; }
365 public int FrameTimeCritPercent { get; private set; }
363 366
364 // Normalize the frame related stats to nominal 55fps for viewer and scripts option 367 // Normalize the frame related stats to nominal 55fps for viewer and scripts option
365 // see SimStatsReporter.cs 368 // see SimStatsReporter.cs
@@ -860,6 +863,8 @@ namespace OpenSim.Region.Framework.Scenes
860 { 863 {
861 m_config = config; 864 m_config = config;
862 FrameTime = 0.0908f; 865 FrameTime = 0.0908f;
866 FrameTimeWarnPercent = 60;
867 FrameTimeCritPercent = 40;
863 Normalized55FPS = true; 868 Normalized55FPS = true;
864 MinMaintenanceTime = 1; 869 MinMaintenanceTime = 1;
865 SeeIntoRegion = true; 870 SeeIntoRegion = true;
@@ -1101,6 +1106,8 @@ namespace OpenSim.Region.Framework.Scenes
1101 } 1106 }
1102 1107
1103 FrameTime = startupConfig.GetFloat( "FrameTime", FrameTime); 1108 FrameTime = startupConfig.GetFloat( "FrameTime", FrameTime);
1109 FrameTimeWarnPercent = startupConfig.GetInt( "FrameTimeWarnPercent", FrameTimeWarnPercent);
1110 FrameTimeCritPercent = startupConfig.GetInt( "FrameTimeCritPercent", FrameTimeCritPercent);
1104 Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS); 1111 Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS);
1105 1112
1106 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); 1113 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup);
@@ -1254,6 +1261,28 @@ namespace OpenSim.Region.Framework.Scenes
1254 1261
1255 if (dm != null) 1262 if (dm != null)
1256 m_eventManager.OnPermissionError += dm.SendAlertToUser; 1263 m_eventManager.OnPermissionError += dm.SendAlertToUser;
1264
1265 ISimulatorFeaturesModule fm = RequestModuleInterface<ISimulatorFeaturesModule>();
1266 if (fm != null)
1267 {
1268 OSD openSimExtras;
1269 OSDMap openSimExtrasMap;
1270
1271 if (!fm.TryGetFeature("OpenSimExtras", out openSimExtras))
1272 openSimExtras = new OSDMap();
1273
1274 float statisticsFPSfactor = 1.0f;
1275 if(Normalized55FPS)
1276 statisticsFPSfactor = 55.0f * FrameTime;
1277
1278 openSimExtrasMap = (OSDMap)openSimExtras;
1279 openSimExtrasMap["SimulatorFPS"] = OSD.FromReal(1.0f / FrameTime);
1280 openSimExtrasMap["SimulatorFPSFactor"] = OSD.FromReal(statisticsFPSfactor);
1281 openSimExtrasMap["SimulatorFPSWarnPercent"] = OSD.FromInteger(FrameTimeWarnPercent);
1282 openSimExtrasMap["SimulatorFPSCritPercent"] = OSD.FromInteger(FrameTimeCritPercent);
1283
1284 fm.AddFeature("OpenSimExtras", openSimExtrasMap);
1285 }
1257 } 1286 }
1258 1287
1259 protected virtual void RegisterDefaultSceneEvents() 1288 protected virtual void RegisterDefaultSceneEvents()
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index fadd359..1481fca 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -174,7 +174,7 @@
174 ; Adicionaly they are scaled to values they whould have on a system running at a nominal 55 frames per second rate 174 ; Adicionaly they are scaled to values they whould have on a system running at a nominal 55 frames per second rate
175 ; The scale factor it 55 * FrameTime, corresponding to 5 with default configuration 175 ; The scale factor it 55 * FrameTime, corresponding to 5 with default configuration
176 ; You can choose to not apply this scale factor setting Normalized55FPS to false. 176 ; You can choose to not apply this scale factor setting Normalized55FPS to false.
177 ; Normalized55FPS = false 177 ; Normalized55FPS = true
178 178
179 ; Main Frame time 179 ; Main Frame time
180 ; This defines the rate of several simulation events. 180 ; This defines the rate of several simulation events.
@@ -185,6 +185,14 @@
185 ; changing this value, you need to change some of the following *EveryNFrames so their actions timing remains the same 185 ; changing this value, you need to change some of the following *EveryNFrames so their actions timing remains the same
186 FrameTime = 0.0909 186 FrameTime = 0.0909
187 187
188 ; The values below represent the percentage of the target frame time that,
189 ; when underrun, should trigger yellow or red in the lag meter.
190 ; Less than 60% of FPS is amber by default, less then 40% is red.
191 ; These values are advisory. Viewers may choose to not use them but it is
192 ; encouraged that they do.
193 ; FrameTimeWarnPercent = 60;
194 ; FrameTimeCritPercent = 40;
195
188 ; Send scheduled updates to objects in the scene 196 ; Send scheduled updates to objects in the scene
189 ; This must be a whole number 197 ; This must be a whole number
190 UpdateObjectsEveryNFrames = 1; 198 UpdateObjectsEveryNFrames = 1;