aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs29
1 files changed, 29 insertions, 0 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()