Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

avinationmerge
Diva Canto 2015-11-12 18:31:27 -08:00
commit 3515fda101
8 changed files with 108 additions and 42 deletions

View File

@ -509,6 +509,8 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
{ {
module.RegionLoaded(scene); module.RegionLoaded(scene);
} }
scene.AllModulesLoaded();
} }
public void RemoveRegionFromModules (Scene scene) public void RemoveRegionFromModules (Scene scene)

View File

@ -39,6 +39,7 @@ using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.Imaging; using OpenMetaverse.Imaging;
using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Monitoring; using OpenSim.Framework.Monitoring;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
@ -381,6 +382,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
private int m_minFrameTicks; private int m_minFrameTicks;
public int FrameTimeWarnPercent { get; private set; }
public int FrameTimeCritPercent { get; private set; }
// Normalize the frame related stats to nominal 55fps for viewer and scripts option
// see SimStatsReporter.cs
public bool Normalized55FPS { get; private set; }
/// <summary> /// <summary>
/// The minimum length of time in seconds that will be taken for a scene frame. /// The minimum length of time in seconds that will be taken for a scene frame.
/// </summary> /// </summary>
@ -856,6 +864,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_config = config; m_config = config;
MinFrameTicks = 89; MinFrameTicks = 89;
FrameTimeWarnPercent = 60;
FrameTimeCritPercent = 40;
Normalized55FPS = true;
MinMaintenanceTicks = 1000; MinMaintenanceTicks = 1000;
SeeIntoRegion = true; SeeIntoRegion = true;
@ -1083,6 +1094,9 @@ namespace OpenSim.Region.Framework.Scenes
if (startupConfig.Contains("MinFrameTime")) if (startupConfig.Contains("MinFrameTime"))
MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000); MinFrameTicks = (int)(startupConfig.GetFloat("MinFrameTime") * 1000);
FrameTimeWarnPercent = startupConfig.GetInt( "FrameTimeWarnPercent", FrameTimeWarnPercent);
FrameTimeCritPercent = startupConfig.GetInt( "FrameTimeCritPercent", FrameTimeCritPercent);
Normalized55FPS = startupConfig.GetBoolean( "Normalized55FPS", Normalized55FPS);
m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup); m_update_backup = startupConfig.GetInt("UpdateStorageEveryNFrames", m_update_backup);
m_update_coarse_locations = startupConfig.GetInt("UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); m_update_coarse_locations = startupConfig.GetInt("UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
@ -1250,13 +1264,44 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_sceneGraph; } get { return m_sceneGraph; }
} }
protected virtual void RegisterDefaultSceneEvents() /// <summary>
/// Called by the module loader when all modules are loaded, after each module's
/// RegionLoaded hook is called. This is the earliest time where RequestModuleInterface
/// may be used.
/// </summary>
public void AllModulesLoaded()
{ {
IDialogModule dm = RequestModuleInterface<IDialogModule>(); IDialogModule dm = RequestModuleInterface<IDialogModule>();
if (dm != null) if (dm != null)
m_eventManager.OnPermissionError += dm.SendAlertToUser; m_eventManager.OnPermissionError += dm.SendAlertToUser;
ISimulatorFeaturesModule fm = RequestModuleInterface<ISimulatorFeaturesModule>();
if (fm != null)
{
OSD openSimExtras;
OSDMap openSimExtrasMap;
if (!fm.TryGetFeature("OpenSimExtras", out openSimExtras))
openSimExtras = new OSDMap();
float FrameTime = MinFrameTicks / 1000.0f;
float statisticsFPSfactor = 1.0f;
if(Normalized55FPS)
statisticsFPSfactor = 55.0f * FrameTime;
openSimExtrasMap = (OSDMap)openSimExtras;
openSimExtrasMap["SimulatorFPS"] = OSD.FromReal(1.0f / FrameTime);
openSimExtrasMap["SimulatorFPSFactor"] = OSD.FromReal(statisticsFPSfactor);
openSimExtrasMap["SimulatorFPSWarnPercent"] = OSD.FromInteger(FrameTimeWarnPercent);
openSimExtrasMap["SimulatorFPSCritPercent"] = OSD.FromInteger(FrameTimeCritPercent);
fm.AddFeature("OpenSimExtras", openSimExtrasMap);
}
}
protected virtual void RegisterDefaultSceneEvents()
{
m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; m_eventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement;
} }

View File

@ -176,11 +176,16 @@ namespace OpenSim.Region.Framework.Scenes
/// Parameter to adjust reported scene fps /// Parameter to adjust reported scene fps
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Our scene loop runs slower than other server implementations, apparantly because we work somewhat differently. /// The close we have to a frame rate as expected by viewers, users and scripts
/// However, we will still report an FPS that's closer to what people are used to seeing. A lower FPS might /// is heartbeat rate.
/// affect clients and monitoring scripts/software. /// heartbeat rate default value is very diferent from the expected one
/// and can be changed from region to region acording to its specific simulation needs
/// since this creates incompatibility with expected values,
/// this scale factor can be used to normalize values to a Virtual FPS.
/// original decision was to use a value of 55fps for all opensim
/// corresponding, with default heartbeat rate, to a value of 5.
/// </remarks> /// </remarks>
private float m_reportedFpsCorrectionFactor = 5; private float m_statisticsFPSfactor = 5.0f;
// saved last reported value so there is something available for llGetRegionFPS // saved last reported value so there is something available for llGetRegionFPS
private float lastReportedSimFPS; private float lastReportedSimFPS;
@ -278,10 +283,15 @@ namespace OpenSim.Region.Framework.Scenes
m_usersLoggingIn = 0; m_usersLoggingIn = 0;
m_scene = scene; m_scene = scene;
m_reportedFpsCorrectionFactor = scene.MinFrameSeconds * m_nominalReportedFps;
m_statsUpdateFactor = (float)(m_statsUpdatesEveryMS / 1000); m_statsUpdateFactor = (float)(m_statsUpdatesEveryMS / 1000);
ReportingRegion = scene.RegionInfo; ReportingRegion = scene.RegionInfo;
if(scene.Normalized55FPS)
m_statisticsFPSfactor = 55.0f * m_scene.MinFrameTicks / 1000.0f;
else
m_statisticsFPSfactor = 1.0f;
m_objectCapacity = scene.RegionInfo.ObjectCapacity; m_objectCapacity = scene.RegionInfo.ObjectCapacity;
m_report.AutoReset = true; m_report.AutoReset = true;
m_report.Interval = m_statsUpdatesEveryMS; m_report.Interval = m_statsUpdatesEveryMS;
@ -381,13 +391,7 @@ namespace OpenSim.Region.Framework.Scenes
#region various statistic googly moogly #region various statistic googly moogly
// ORIGINAL code commented out until we have time to add our own int reportedFPS = (int)(m_fps * m_statisticsFPSfactor);
// statistics to the statistics window, this will be done as a
// new section given the title of our current project
// We're going to lie about the FPS because we've been lying since 2008. The actual FPS is currently
// locked at a maximum of 11. Maybe at some point this can change so that we're not lying.
//int reportedFPS = (int)(m_fps * m_reportedFpsCorrectionFactor);
int reportedFPS = m_fps;
// save the reported value so there is something available for llGetRegionFPS // save the reported value so there is something available for llGetRegionFPS
lastReportedSimFPS = reportedFPS / m_statsUpdateFactor; lastReportedSimFPS = reportedFPS / m_statsUpdateFactor;
@ -395,7 +399,7 @@ namespace OpenSim.Region.Framework.Scenes
// ORIGINAL code commented out until we have time to add our own // ORIGINAL code commented out until we have time to add our own
// statistics to the statistics window // statistics to the statistics window
//float physfps = ((m_pfps / 1000)); //float physfps = ((m_pfps / 1000));
float physfps = m_numberPhysicsFrames; float physfps = m_numberPhysicsFrames * m_statisticsFPSfactor;
//if (physfps > 600) //if (physfps > 600)
//physfps = physfps - (physfps - 600); //physfps = physfps - (physfps - 600);
@ -429,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
uint thisFrame = m_scene.Frame; uint thisFrame = m_scene.Frame;
uint numFrames = thisFrame - m_lastUpdateFrame; uint numFrames = thisFrame - m_lastUpdateFrame;
float framesUpdated = (float)numFrames * m_reportedFpsCorrectionFactor; float framesUpdated = (float)numFrames * m_statisticsFPSfactor;
m_lastUpdateFrame = thisFrame; m_lastUpdateFrame = thisFrame;
// Avoid div-by-zero if somehow we've not updated any frames. // Avoid div-by-zero if somehow we've not updated any frames.
@ -502,22 +506,22 @@ namespace OpenSim.Region.Framework.Scenes
// statistics to the statistics window // statistics to the statistics window
sb[8].StatID = (uint)Stats.FrameMS; sb[8].StatID = (uint)Stats.FrameMS;
//sb[8].StatValue = m_frameMS / framesUpdated; //sb[8].StatValue = m_frameMS / framesUpdated;
sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored; sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
sb[9].StatID = (uint)Stats.NetMS; sb[9].StatID = (uint)Stats.NetMS;
//sb[9].StatValue = m_netMS / framesUpdated; //sb[9].StatValue = m_netMS / framesUpdated;
sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored; sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
sb[10].StatID = (uint)Stats.PhysicsMS; sb[10].StatID = (uint)Stats.PhysicsMS;
//sb[10].StatValue = m_physicsMS / framesUpdated; //sb[10].StatValue = m_physicsMS / framesUpdated;
sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored; sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
sb[11].StatID = (uint)Stats.ImageMS ; sb[11].StatID = (uint)Stats.ImageMS ;
sb[11].StatValue = m_imageMS / framesUpdated; sb[11].StatValue = m_imageMS / framesUpdated;
sb[12].StatID = (uint)Stats.OtherMS; sb[12].StatID = (uint)Stats.OtherMS;
//sb[12].StatValue = m_otherMS / framesUpdated; //sb[12].StatValue = m_otherMS / framesUpdated;
sb[12].StatValue = (float) simulationSumFrameTime / m_numberFramesStored; sb[12].StatValue = (float) simulationSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
sb[13].StatID = (uint)Stats.InPacketsPerSecond; sb[13].StatID = (uint)Stats.InPacketsPerSecond;
sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor); sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor);

View File

@ -610,17 +610,16 @@
[SimulatorFeatures] [SimulatorFeatures]
;# {SearchServerURI} {} {URL of the search server} {} ;# {SearchServerURI} {} {URL of the search server} {}
;; This is identical to the Robust LoginService SearchURL setting ;; Optional. If given this serves the same purpose as the grid wide
;; and will override that value if set here. The Robust setting ;; [LoginServices] SearchURL setting and will override that where
;; provides a working default for the grid and setting here is ;; supported by viewers.
;; optional.
;SearchServerURI = "http://127.0.0.1:9000/" ;SearchServerURI = "http://127.0.0.1:9000/"
;# {DestinationGuideURI} {} {URL of the destination guide} {} ;# {DestinationGuideURI} {} {URL of the destination guide} {}
;; ;; Optional. If given this serves the same purpose as the grid wide
;; This serves the same purpose as the DestinationGuideURI in the ;; [LoginServices] DestinationGuide setting and will override that where
;; LoginService setting in the Robust server. This will override ;; supported by viewers.
;; the Robust setting if desired as an option. ;DestinationGuideURI = "http://127.0.0.1:9000/guide"
;DestinationGuideURI = "http://127.0.0.1:9000/"
[Chat] [Chat]

View File

@ -166,12 +166,30 @@
; into a restart. ; into a restart.
InworldRestartShutsDown = false InworldRestartShutsDown = false
; Use of normalized 55FPS statistics
; Opensim does not have a frame rate control like other simulators
; Most parameters that control timing can be configurable region by region
; To achive closer compatibility with values expected by viewers, scripts and users
; some parameters are converted to a equivalent per frame value.
; Adicionaly they are scaled to values they whould have on a system running at a nominal 55 frames per second rate
; The scale factor it 55 * FrameTime, corresponding to 5 with default configuration
; You can choose to not apply this scale factor setting Normalized55FPS to false.
; Normalized55FPS = true
; The minimum proportion of a second that any particular frame can take to execute. ; The minimum proportion of a second that any particular frame can take to execute.
; Only change this if you really know what you're doing, and be prepared to change UpdatePhysicsEveryNFrames ; Only change this if you really know what you're doing, and be prepared to change UpdatePhysicsEveryNFrames
; (and other Frames params) to match! For instance, halving MinFrameTime to 0.0445 require ; (and other Frames params) to match! For instance, halving MinFrameTime to 0.0445 require
; UpdatePhysicsEveryNFrames = 2 unless you don't mind your avatar walking like Benny Hill. ; UpdatePhysicsEveryNFrames = 2 unless you don't mind your avatar walking like Benny Hill.
MinFrameTime = 0.089 MinFrameTime = 0.089
; The values below represent the percentage of the target frame time that,
; when underrun, should trigger yellow or red in the lag meter.
; Less than 60% of FPS is amber by default, less then 40% is red.
; These values are advisory. Viewers may choose to not use them but it is
; encouraged that they do.
; FrameTimeWarnPercent = 60;
; FrameTimeCritPercent = 40;
; Send scheduled updates to objects in the scene ; Send scheduled updates to objects in the scene
; This must be a whole number ; This must be a whole number
UpdateObjectsEveryNFrames = 1; UpdateObjectsEveryNFrames = 1;

View File

@ -551,12 +551,12 @@
; this as splash page ; this as splash page
;welcome = ${Const|BaseURL}/welcome ;welcome = ${Const|BaseURL}/welcome
; helper uri: optional: if it exists if will be used to tell the client to use ; helper uri: optional: if it exists it will be used to tell the client to use
; this for all economy related things ; this for all economy related things
;economy = ${Const|BaseURL}:${Const|PublicPort}/ ;economy = ${Const|BaseURL}/economy
; web page of grid: optional: page providing further information about your grid ; web page of grid: optional: page providing further information about your grid
;about = ${Const|BaseURL}/about/ ;about = ${Const|BaseURL}/about
; account creation: optional: page providing further information about obtaining ; account creation: optional: page providing further information about obtaining
; a user account on your grid ; a user account on your grid

View File

@ -538,12 +538,12 @@
; this as splash page ; this as splash page
;welcome = ${Const|BaseURL}/welcome ;welcome = ${Const|BaseURL}/welcome
; helper uri: optional: if it exists if will be used to tell the client to use ; helper uri: optional: if it exists it will be used to tell the client to use
; this for all economy related things ; this for all economy related things
;economy = ${Const|BaseURL}:${Const|PublicPort}/ ;economy = ${Const|BaseURL}/economy
; web page of grid: optional: page providing further information about your grid ; web page of grid: optional: page providing further information about your grid
;about = ${Const|BaseURL}/about/ ;about = ${Const|BaseURL}/about
; account creation: optional: page providing further information about obtaining ; account creation: optional: page providing further information about obtaining
; a user account on your grid ; a user account on your grid

View File

@ -134,6 +134,9 @@
; Url to search service ; Url to search service
; SearchURL = "${Const|BaseURL}:${Const|PublicPort}"; ; SearchURL = "${Const|BaseURL}:${Const|PublicPort}";
; For V3 destination guide
; DestinationGuide = "${Const|BaseURL}/guide"
; The minimum user level required for a user to be able to login. 0 by default ; The minimum user level required for a user to be able to login. 0 by default
; If you disable a particular user's account then you can set their login level below this number. ; If you disable a particular user's account then you can set their login level below this number.
; You can also change this level from the console though these changes will not be persisted. ; You can also change this level from the console though these changes will not be persisted.
@ -222,26 +225,21 @@
; information on a standalone ; information on a standalone
;welcome = ${Const|BaseURL}/welcome ;welcome = ${Const|BaseURL}/welcome
; helper uri: optional: if it exists if will be used to tell the client to use ; helper uri: optional: if it exists it will be used to tell the client to use
; this for all economy related things ; this for all economy related things
; currently unused ;economy = ${Const|BaseURL}/economy
;economy = ${Const|BaseURL}:${Const|PublicPort}/
; web page of grid: optional: page providing further information about your grid ; web page of grid: optional: page providing further information about your grid
; currently unused ;about = ${Const|BaseURL}/about
;about = ${Const|BaseURL}/about/
; account creation: optional: page providing further information about obtaining ; account creation: optional: page providing further information about obtaining
; a user account on your grid ; a user account on your grid
; currently unused
;register = ${Const|BaseURL}/register ;register = ${Const|BaseURL}/register
; help: optional: page providing further assistance for users of your grid ; help: optional: page providing further assistance for users of your grid
; currently unused
;help = ${Const|BaseURL}/help ;help = ${Const|BaseURL}/help
; password help: optional: page providing password assistance for users of your grid ; password help: optional: page providing password assistance for users of your grid
; currently unused
;password = ${Const|BaseURL}/password ;password = ${Const|BaseURL}/password
; HG address of the gatekeeper, if you have one ; HG address of the gatekeeper, if you have one