aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2015-11-13 02:12:13 +0000
committerUbitUmarov2015-11-13 02:12:13 +0000
commit75befda6df8f0000122e440ad437338287c5d27c (patch)
tree6210625cd5b53ddf2d2880634e60d8fffa7a69e0 /OpenSim/Region
parent add the option Normalized55FPS. This is transition code ported from avinatio... (diff)
downloadopensim-SC-75befda6df8f0000122e440ad437338287c5d27c.zip
opensim-SC-75befda6df8f0000122e440ad437338287c5d27c.tar.gz
opensim-SC-75befda6df8f0000122e440ad437338287c5d27c.tar.bz2
opensim-SC-75befda6df8f0000122e440ad437338287c5d27c.tar.xz
Add some values to the SimulatorFeatures cap's OpenSimExtras section relative to FPS statistics. This is transition code ported from avinationmerge.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs41
1 files changed, 40 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cca8963..2fe6e22 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;
@@ -381,6 +382,9 @@ namespace OpenSim.Region.Framework.Scenes
381 } 382 }
382 private int m_minFrameTicks; 383 private int m_minFrameTicks;
383 384
385 public int FrameTimeWarnPercent { get; private set; }
386 public int FrameTimeCritPercent { get; private set; }
387
384 // Normalize the frame related stats to nominal 55fps for viewer and scripts option 388 // Normalize the frame related stats to nominal 55fps for viewer and scripts option
385 // see SimStatsReporter.cs 389 // see SimStatsReporter.cs
386 public bool Normalized55FPS { get; private set; } 390 public bool Normalized55FPS { get; private set; }
@@ -860,6 +864,8 @@ namespace OpenSim.Region.Framework.Scenes
860 { 864 {
861 m_config = config; 865 m_config = config;
862 MinFrameTicks = 89; 866 MinFrameTicks = 89;
867 FrameTimeWarnPercent = 60;
868 FrameTimeCritPercent = 40;
863 Normalized55FPS = true; 869 Normalized55FPS = true;
864 MinMaintenanceTicks = 1000; 870 MinMaintenanceTicks = 1000;
865 SeeIntoRegion = true; 871 SeeIntoRegion = true;
@@ -1088,6 +1094,8 @@ namespace OpenSim.Region.Framework.Scenes
1088 1094
1089 if (startupConfig.Contains("MinFrameTime")) 1095 if (startupConfig.Contains("MinFrameTime"))
1090 MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000); 1096 MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000);
1097 FrameTimeWarnPercent = startupConfig.GetInt( "FrameTimeWarnPercent", FrameTimeWarnPercent);
1098 FrameTimeCritPercent = startupConfig.GetInt( "FrameTimeCritPercent", FrameTimeCritPercent);
1091 Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS); 1099 Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS);
1092 1100
1093 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); 1101 m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup);
@@ -1256,13 +1264,44 @@ namespace OpenSim.Region.Framework.Scenes
1256 get { return m_sceneGraph; } 1264 get { return m_sceneGraph; }
1257 } 1265 }
1258 1266
1259 protected virtual void RegisterDefaultSceneEvents() 1267 /// <summary>
1268 /// Called by the module loader when all modules are loaded, after each module's
1269 /// RegionLoaded hook is called. This is the earliest time where RequestModuleInterface
1270 /// may be used.
1271 /// </summary>
1272 public void AllModulesLoaded()
1260 { 1273 {
1261 IDialogModule dm = RequestModuleInterface<IDialogModule>(); 1274 IDialogModule dm = RequestModuleInterface<IDialogModule>();
1262 1275
1263 if (dm != null) 1276 if (dm != null)
1264 m_eventManager.OnPermissionError += dm.SendAlertToUser; 1277 m_eventManager.OnPermissionError += dm.SendAlertToUser;
1265 1278
1279 ISimulatorFeaturesModule fm = RequestModuleInterface<ISimulatorFeaturesModule>();
1280 if (fm != null)
1281 {
1282 OSD openSimExtras;
1283 OSDMap openSimExtrasMap;
1284
1285 if (!fm.TryGetFeature("OpenSimExtras", out openSimExtras))
1286 openSimExtras = new OSDMap();
1287
1288 float FrameTime = MinFrameTicks / 1000.0f;
1289 float statisticsFPSfactor = 1.0f;
1290 if(Normalized55FPS)
1291 statisticsFPSfactor = 55.0f * FrameTime;
1292
1293 openSimExtrasMap = (OSDMap)openSimExtras;
1294 openSimExtrasMap["SimulatorFPS"] = OSD.FromReal(1.0f / FrameTime);
1295 openSimExtrasMap["SimulatorFPSFactor"] = OSD.FromReal(statisticsFPSfactor);
1296 openSimExtrasMap["SimulatorFPSWarnPercent"] = OSD.FromInteger(FrameTimeWarnPercent);
1297 openSimExtrasMap["SimulatorFPSCritPercent"] = OSD.FromInteger(FrameTimeCritPercent);
1298
1299 fm.AddFeature("OpenSimExtras", openSimExtrasMap);
1300 }
1301 }
1302
1303 protected virtual void RegisterDefaultSceneEvents()
1304 {
1266 m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; 1305 m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement;
1267 } 1306 }
1268 1307