Phase 2 additons with Frame Dilation metric.

fsassets
Robert Louden 2015-04-21 16:15:48 -04:00
parent 1959eb8372
commit c3138f9f38
3 changed files with 5822 additions and 5797 deletions

View File

@ -72,6 +72,7 @@ namespace OpenSim.Framework.Monitoring
private volatile float pendingUploads; private volatile float pendingUploads;
private volatile float activeScripts; private volatile float activeScripts;
private volatile float scriptLinesPerSecond; private volatile float scriptLinesPerSecond;
private volatile float m_frameDilation;
private volatile float m_usersLoggingIn; private volatile float m_usersLoggingIn;
private volatile float m_totalGeoPrims; private volatile float m_totalGeoPrims;
private volatile float m_totalMeshes; private volatile float m_totalMeshes;
@ -257,7 +258,7 @@ namespace OpenSim.Framework.Monitoring
// For an unknown reason the original designers decided not to // For an unknown reason the original designers decided not to
// include the spare MS statistic inside of this class, this is // include the spare MS statistic inside of this class, this is
// located inside the StatsBlock at location 21 thus it is skipped // located inside the StatsBlock at location 21, thus it is skipped
timeDilation = stats.StatsBlock[0].StatValue; timeDilation = stats.StatsBlock[0].StatValue;
simFps = stats.StatsBlock[1].StatValue; simFps = stats.StatsBlock[1].StatValue;
physicsFps = stats.StatsBlock[2].StatValue; physicsFps = stats.StatsBlock[2].StatValue;
@ -279,10 +280,11 @@ namespace OpenSim.Framework.Monitoring
pendingUploads = stats.StatsBlock[18].StatValue; pendingUploads = stats.StatsBlock[18].StatValue;
activeScripts = stats.StatsBlock[19].StatValue; activeScripts = stats.StatsBlock[19].StatValue;
scriptLinesPerSecond = stats.StatsBlock[20].StatValue; scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
m_usersLoggingIn = stats.StatsBlock[22].StatValue; m_frameDilation = stats.StatsBlock[22].StatValue;
m_totalGeoPrims = stats.StatsBlock[23].StatValue; m_usersLoggingIn = stats.StatsBlock[23].StatValue;
m_totalMeshes = stats.StatsBlock[24].StatValue; m_totalGeoPrims = stats.StatsBlock[24].StatValue;
m_inUseThreads = stats.StatsBlock[25].StatValue; m_totalMeshes = stats.StatsBlock[25].StatValue;
m_inUseThreads = stats.StatsBlock[26].StatValue;
} }
/// <summary> /// <summary>
@ -474,14 +476,13 @@ Asset service request failures: {3}" + Environment.NewLine,
args["Uptime"] = OSD.FromString (uptime); args["Uptime"] = OSD.FromString (uptime);
args["Version"] = OSD.FromString (version); args["Version"] = OSD.FromString (version);
args["FrameDilatn"] = OSD.FromString(String.Format("{0:0.##}", m_frameDilation));
args["Logging in Users"] = OSD.FromString(String.Format("{0:0.##}", args["Logging in Users"] = OSD.FromString(String.Format("{0:0.##}",
m_usersLoggingIn)); m_usersLoggingIn));
args["GeoPrims"] = OSD.FromString(String.Format("{0:0.##}", args["GeoPrims"] = OSD.FromString(String.Format("{0:0.##}",
m_totalGeoPrims)); m_totalGeoPrims));
args["Mesh Objects"] = OSD.FromString(String.Format("{0:0.##}", args["Mesh Objects"] = OSD.FromString(String.Format("{0:0.##}",
m_totalMeshes)); m_totalMeshes));
args["Polygon Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
args["Texture Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
args["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}", args["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
m_inUseThreads)); m_inUseThreads));
args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}", args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}",

View File

@ -48,7 +48,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Scripting; using OpenSim.Region.Framework.Scenes.Scripting;
using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Region.Physics.Manager; using OpenSim.Region.Physics.Manager;
using Timer=System.Timers.Timer; using Timer = System.Timers.Timer;
using TPFlags = OpenSim.Framework.Constants.TeleportFlags; using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
using GridRegion = OpenSim.Services.Interfaces.GridRegion; using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using PermissionMask = OpenSim.Framework.PermissionMask; using PermissionMask = OpenSim.Framework.PermissionMask;
@ -267,7 +267,8 @@ namespace OpenSim.Region.Framework.Scenes
public float DefaultDrawDistance public float DefaultDrawDistance
{ {
// get { return m_defaultDrawDistance; } // get { return m_defaultDrawDistance; }
get { get
{
if (RegionInfo != null) if (RegionInfo != null)
{ {
float largestDimension = Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY); float largestDimension = Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY);
@ -403,7 +404,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_update_events = 1; private int m_update_events = 1;
private int m_update_backup = 200; private int m_update_backup = 200;
private int m_update_terrain = 50; private int m_update_terrain = 50;
// private int m_update_land = 1; // private int m_update_land = 1;
private int m_update_coarse_locations = 50; private int m_update_coarse_locations = 50;
private int m_update_temp_cleaning = 180; private int m_update_temp_cleaning = 180;
@ -800,12 +801,14 @@ namespace OpenSim.Region.Framework.Scenes
// can be closest/random/sequence // can be closest/random/sequence
public string SpawnPointRouting public string SpawnPointRouting
{ {
get; private set; get;
private set;
} }
// allow landmarks to pass // allow landmarks to pass
public bool TelehubAllowLandmarks public bool TelehubAllowLandmarks
{ {
get; private set; get;
private set;
} }
#endregion Properties #endregion Properties
@ -1044,15 +1047,15 @@ 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);
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);
m_update_entitymovement = startupConfig.GetInt( "UpdateEntityMovementEveryNFrames", m_update_entitymovement); m_update_entitymovement = startupConfig.GetInt("UpdateEntityMovementEveryNFrames", m_update_entitymovement);
m_update_events = startupConfig.GetInt( "UpdateEventsEveryNFrames", m_update_events); m_update_events = startupConfig.GetInt("UpdateEventsEveryNFrames", m_update_events);
m_update_objects = startupConfig.GetInt( "UpdateObjectsEveryNFrames", m_update_objects); m_update_objects = startupConfig.GetInt("UpdateObjectsEveryNFrames", m_update_objects);
m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics); m_update_physics = startupConfig.GetInt("UpdatePhysicsEveryNFrames", m_update_physics);
m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences); m_update_presences = startupConfig.GetInt("UpdateAgentsEveryNFrames", m_update_presences);
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); m_update_terrain = startupConfig.GetInt("UpdateTerrainEveryNFrames", m_update_terrain);
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNSeconds", m_update_temp_cleaning); m_update_temp_cleaning = startupConfig.GetInt("UpdateTempCleaningEveryNSeconds", m_update_temp_cleaning);
} }
// FIXME: Ultimately this should be in a module. // FIXME: Ultimately this should be in a module.
@ -1148,7 +1151,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo) public Scene(RegionInfo regInfo, PhysicsScene physicsScene)
: base(regInfo)
{ {
m_sceneGraph = new SceneGraph(this); m_sceneGraph = new SceneGraph(this);
m_sceneGraph.PhysicsScene = physicsScene; m_sceneGraph.PhysicsScene = physicsScene;
@ -1454,7 +1458,7 @@ namespace OpenSim.Region.Framework.Scenes
m_isRunning = true; m_isRunning = true;
m_active = true; m_active = true;
// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName); // m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
if (m_heartbeatThread != null) if (m_heartbeatThread != null)
{ {
m_heartbeatThread.Abort(); m_heartbeatThread.Abort();
@ -1536,7 +1540,7 @@ namespace OpenSim.Region.Framework.Scenes
// If the last frame did not complete on time, then immediately start the next update on the same thread // If the last frame did not complete on time, then immediately start the next update on the same thread
// and ignore further timed updates until we have a frame that had spare time. // and ignore further timed updates until we have a frame that had spare time.
while (!Update(1) && Active) {} while (!Update(1) && Active) { }
if (!Active || m_shuttingDown) if (!Active || m_shuttingDown)
{ {
@ -1572,7 +1576,7 @@ namespace OpenSim.Region.Framework.Scenes
runtc = Util.EnvironmentTickCount(); runtc = Util.EnvironmentTickCount();
++MaintenanceRun; ++MaintenanceRun;
// m_log.DebugFormat("[SCENE]: Maintenance run {0} in {1}", MaintenanceRun, Name); // m_log.DebugFormat("[SCENE]: Maintenance run {0} in {1}", MaintenanceRun, Name);
// Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client)
if (MaintenanceRun % (m_update_coarse_locations / 10) == 0) if (MaintenanceRun % (m_update_coarse_locations / 10) == 0)
@ -1587,7 +1591,7 @@ namespace OpenSim.Region.Framework.Scenes
if (SendPeriodicAppearanceUpdates && MaintenanceRun % 60 == 0) if (SendPeriodicAppearanceUpdates && MaintenanceRun % 60 == 0)
{ {
// m_log.DebugFormat("[SCENE]: Sending periodic appearance updates"); // m_log.DebugFormat("[SCENE]: Sending periodic appearance updates");
if (AvatarFactory != null) if (AvatarFactory != null)
{ {
@ -1598,7 +1602,7 @@ namespace OpenSim.Region.Framework.Scenes
// Delete temp-on-rez stuff // Delete temp-on-rez stuff
if (MaintenanceRun % m_update_temp_cleaning == 0 && !m_cleaningTemps) if (MaintenanceRun % m_update_temp_cleaning == 0 && !m_cleaningTemps)
{ {
// m_log.DebugFormat("[SCENE]: Running temp-on-rez cleaning in {0}", Name); // m_log.DebugFormat("[SCENE]: Running temp-on-rez cleaning in {0}", Name);
tmpMS = Util.EnvironmentTickCount(); tmpMS = Util.EnvironmentTickCount();
m_cleaningTemps = true; m_cleaningTemps = true;
@ -1661,7 +1665,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
++Frame; ++Frame;
// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
agentMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0; agentMS = eventMS = backupMS = terrainMS = landMS = spareMS = 0;
@ -1673,7 +1677,14 @@ namespace OpenSim.Region.Framework.Scenes
if (Frame % m_update_terrain == 0) if (Frame % m_update_terrain == 0)
{ {
tmpMS = Util.EnvironmentTickCount(); tmpMS = Util.EnvironmentTickCount();
simFrameStopwatch.Start();
UpdateTerrain(); UpdateTerrain();
// Get the simulation frame time that the avatar force
// input took
simFrameStopwatch.Stop();
preciseSimFrameTime =
simFrameStopwatch.Elapsed.TotalMilliseconds;
terrainMS = Util.EnvironmentTickCountSubtract(tmpMS); terrainMS = Util.EnvironmentTickCountSubtract(tmpMS);
} }
@ -1705,13 +1716,15 @@ namespace OpenSim.Region.Framework.Scenes
// Apply any pending avatar force input to the avatar's velocity // Apply any pending avatar force input to the avatar's velocity
tmpMS = Util.EnvironmentTickCount(); tmpMS = Util.EnvironmentTickCount();
simFrameStopwatch.Start(); simFrameStopwatch.Restart();
if (Frame % m_update_entitymovement == 0) if (Frame % m_update_entitymovement == 0)
m_sceneGraph.UpdateScenePresenceMovement(); m_sceneGraph.UpdateScenePresenceMovement();
// Get the simulation frame time that the avatar force input took // Get the simulation frame time that the avatar force input
// took
simFrameStopwatch.Stop(); simFrameStopwatch.Stop();
preciseSimFrameTime = simFrameStopwatch.Elapsed.TotalMilliseconds; preciseSimFrameTime +=
simFrameStopwatch.Elapsed.TotalMilliseconds;
agentMS = Util.EnvironmentTickCountSubtract(tmpMS); agentMS = Util.EnvironmentTickCountSubtract(tmpMS);
// Perform the main physics update. This will do the actual work of moving objects and avatars according to their // Perform the main physics update. This will do the actual work of moving objects and avatars according to their
@ -1821,6 +1834,11 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerRegionHeartbeatEnd(this); EventManager.TriggerRegionHeartbeatEnd(this);
otherMS = eventMS + backupMS + terrainMS + landMS; otherMS = eventMS + backupMS + terrainMS + landMS;
// Get the elapsed time for the simulation frame
simFrameStopwatch.Stop();
preciseSimFrameTime +=
simFrameStopwatch.Elapsed.TotalMilliseconds;
if (!UpdateOnTimer) if (!UpdateOnTimer)
{ {
Watchdog.UpdateThread(); Watchdog.UpdateThread();
@ -1837,9 +1855,13 @@ namespace OpenSim.Region.Framework.Scenes
spareMS = Math.Max(0, MinFrameTicks - physicsMS2 - agentMS - physicsMS - otherMS); spareMS = Math.Max(0, MinFrameTicks - physicsMS2 - agentMS - physicsMS - otherMS);
} }
// Get the elapsed time for the simulation frame // Get the total frame time
simFrameStopwatch.Stop(); totalFrameStopwatch.Stop();
preciseSimFrameTime += simFrameStopwatch.Elapsed.TotalMilliseconds; preciseTotalFrameTime =
totalFrameStopwatch.Elapsed.TotalMilliseconds;
// Restart the stopwatch for the total time of the next frame
totalFrameStopwatch.Restart();
previousFrameTick = m_lastFrameTick; previousFrameTick = m_lastFrameTick;
frameMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick); frameMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick);
@ -1998,7 +2020,7 @@ namespace OpenSim.Region.Framework.Scenes
IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
if (tr != null) if (tr != null)
tr.SendInstantMessage(msg, delegate(bool success) {}); tr.SendInstantMessage(msg, delegate(bool success) { });
} }
m_returns.Clear(); m_returns.Clear();
} }
@ -2108,7 +2130,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace); e.Message, e.StackTrace);
// Non standard region size. If there's an old terrain in the database, it might read past the buffer // Non standard region size. If there's an old terrain in the database, it might read past the buffer
#pragma warning disable 0162 #pragma warning disable 0162
if ((int)Constants.RegionSize != 256) if ((int)Constants.RegionSize != 256)
{ {
Heightmap = new TerrainChannel(); Heightmap = new TerrainChannel();
@ -2140,11 +2162,11 @@ namespace OpenSim.Region.Framework.Scenes
GridRegion region = new GridRegion(RegionInfo); GridRegion region = new GridRegion(RegionInfo);
string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
// m_log.DebugFormat("[SCENE]: RegisterRegionWithGrid. name={0},id={1},loc=<{2},{3}>,size=<{4},{5}>", // m_log.DebugFormat("[SCENE]: RegisterRegionWithGrid. name={0},id={1},loc=<{2},{3}>,size=<{4},{5}>",
// m_regionName, // m_regionName,
// RegionInfo.RegionID, // RegionInfo.RegionID,
// RegionInfo.RegionLocX, RegionInfo.RegionLocY, // RegionInfo.RegionLocX, RegionInfo.RegionLocY,
// RegionInfo.RegionSizeX, RegionInfo.RegionSizeY); // RegionInfo.RegionSizeX, RegionInfo.RegionSizeY);
if (error != String.Empty) if (error != String.Empty)
throw new Exception(error); throw new Exception(error);
@ -2206,7 +2228,7 @@ namespace OpenSim.Region.Framework.Scenes
rootPart.TrimPermissions(); rootPart.TrimPermissions();
// Don't do this here - it will get done later on when sculpt data is loaded. // Don't do this here - it will get done later on when sculpt data is loaded.
// group.CheckSculptAndLoad(); // group.CheckSculptAndLoad();
} }
LoadingPrims = false; LoadingPrims = false;
@ -2224,7 +2246,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (PhysicsScene == null) if (PhysicsScene == null)
return null; return null;
return PhysicsScene.RaycastWorld(position, direction, length, Count,filter); return PhysicsScene.RaycastWorld(position, direction, length, Count, filter);
} }
/// <summary> /// <summary>
@ -2552,7 +2574,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="removeScripts">If true, then scripts are removed. If false, then they are only stopped.</para> /// <param name="removeScripts">If true, then scripts are removed. If false, then they are only stopped.</para>
public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts) public void DeleteSceneObject(SceneObjectGroup group, bool silent, bool removeScripts)
{ {
// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); // m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
if (removeScripts) if (removeScripts)
group.RemoveScriptInstances(true); group.RemoveScriptInstances(true);
@ -2587,7 +2609,7 @@ namespace OpenSim.Region.Framework.Scenes
group.DeleteGroupFromScene(silent); group.DeleteGroupFromScene(silent);
// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
} }
/// <summary> /// <summary>
@ -2687,7 +2709,7 @@ namespace OpenSim.Region.Framework.Scenes
if (regionCombinerModule == null) if (regionCombinerModule == null)
{ {
// Regular region. Just check for region size // Regular region. Just check for region size
if (xx < RegionInfo.RegionSizeX && yy < RegionInfo.RegionSizeY ) if (xx < RegionInfo.RegionSizeX && yy < RegionInfo.RegionSizeY)
ret = true; ret = true;
} }
else else
@ -2764,10 +2786,10 @@ namespace OpenSim.Region.Framework.Scenes
{ {
SceneObjectGroup grp = sceneObject; SceneObjectGroup grp = sceneObject;
// m_log.DebugFormat( // m_log.DebugFormat(
// "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID); // "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID);
// m_log.DebugFormat( // m_log.DebugFormat(
// "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
@ -3744,15 +3766,15 @@ namespace OpenSim.Region.Framework.Scenes
// vulnerable to an issue when a viewer quits a region without sending a proper logout but then // vulnerable to an issue when a viewer quits a region without sending a proper logout but then
// re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport // re-establishes the connection on a relogin. This could wrongly set the DoNotCloseAfterTeleport
// flag when no teleport had taken place (and hence no close was going to come). // flag when no teleport had taken place (and hence no close was going to come).
// if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle)) // if (!acd.ChildrenCapSeeds.ContainsKey(RegionInfo.RegionHandle))
// { // {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.", // "[SCENE]: Setting DoNotCloseAfterTeleport for child scene presence {0} in {1} because source will attempt close.",
// sp.Name, Name); // sp.Name, Name);
// //
// sp.DoNotCloseAfterTeleport = true; // sp.DoNotCloseAfterTeleport = true;
// } // }
// else if (EntityTransferModule.IsInTransit(sp.UUID)) // else if (EntityTransferModule.IsInTransit(sp.UUID))
sp.LifecycleState = ScenePresenceState.Running; sp.LifecycleState = ScenePresenceState.Running;
@ -3916,7 +3938,7 @@ namespace OpenSim.Region.Framework.Scenes
if (vialogin) if (vialogin)
{ {
// CleanDroppedAttachments(); // CleanDroppedAttachments();
// Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking) // Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking)
if (acd.startpos.X < 0) acd.startpos.X = 1f; if (acd.startpos.X < 0) acd.startpos.X = 1f;
@ -3924,9 +3946,9 @@ namespace OpenSim.Region.Framework.Scenes
if (acd.startpos.Y < 0) acd.startpos.Y = 1f; if (acd.startpos.Y < 0) acd.startpos.Y = 1f;
if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f; if (acd.startpos.Y >= RegionInfo.RegionSizeY) acd.startpos.Y = RegionInfo.RegionSizeY - 1f;
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}", // "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name); // RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
@ -4243,69 +4265,69 @@ namespace OpenSim.Region.Framework.Scenes
return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
} }
// /// <summary> // /// <summary>
// /// The Grid has requested that we log-off a user. Log them off. // /// The Grid has requested that we log-off a user. Log them off.
// /// </summary> // /// </summary>
// /// <param name="AvatarID">Unique ID of the avatar to log-off</param> // /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
// /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param> // /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
// /// <param name="message">message to display to the user. Reason for being logged off</param> // /// <param name="message">message to display to the user. Reason for being logged off</param>
// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) // public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
// { // {
// ScenePresence loggingOffUser = GetScenePresence(AvatarID); // ScenePresence loggingOffUser = GetScenePresence(AvatarID);
// if (loggingOffUser != null) // if (loggingOffUser != null)
// { // {
// UUID localRegionSecret = UUID.Zero; // UUID localRegionSecret = UUID.Zero;
// bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret); // bool parsedsecret = UUID.TryParse(RegionInfo.regionSecret, out localRegionSecret);
// //
// // Region Secret is used here in case a new sessionid overwrites an old one on the user server. // // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
// // Will update the user server in a few revisions to use it. // // Will update the user server in a few revisions to use it.
// //
// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret)) // if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
// { // {
// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles); // m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
// loggingOffUser.ControllingClient.Kick(message); // loggingOffUser.ControllingClient.Kick(message);
// // Give them a second to receive the message! // // Give them a second to receive the message!
// Thread.Sleep(1000); // Thread.Sleep(1000);
// loggingOffUser.ControllingClient.Close(); // loggingOffUser.ControllingClient.Close();
// } // }
// else // else
// { // {
// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate"); // m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
// } // }
// } // }
// else // else
// { // {
// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); // m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
// } // }
// } // }
// /// <summary> // /// <summary>
// /// Triggered when an agent crosses into this sim. Also happens on initial login. // /// Triggered when an agent crosses into this sim. Also happens on initial login.
// /// </summary> // /// </summary>
// /// <param name="agentID"></param> // /// <param name="agentID"></param>
// /// <param name="position"></param> // /// <param name="position"></param>
// /// <param name="isFlying"></param> // /// <param name="isFlying"></param>
// public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) // public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
// { // {
// ScenePresence presence = GetScenePresence(agentID); // ScenePresence presence = GetScenePresence(agentID);
// if (presence != null) // if (presence != null)
// { // {
// try // try
// { // {
// presence.MakeRootAgent(position, isFlying); // presence.MakeRootAgent(position, isFlying);
// } // }
// catch (Exception e) // catch (Exception e)
// { // {
// m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace); // m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
// } // }
// } // }
// else // else
// { // {
// m_log.ErrorFormat( // m_log.ErrorFormat(
// "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", // "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
// agentID, RegionInfo.RegionName); // agentID, RegionInfo.RegionName);
// } // }
// } // }
/// <summary> /// <summary>
/// We've got an update about an agent that sees into this region, /// We've got an update about an agent that sees into this region,
@ -4383,17 +4405,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>true if we handled it.</returns> /// <returns>true if we handled it.</returns>
public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData) public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}", // "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}",
// cAgentData.AgentID, Name, cAgentData.Position); // cAgentData.AgentID, Name, cAgentData.Position);
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null) if (childAgentUpdate != null)
{ {
// if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID) // if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID)
// // Only warn for now // // Only warn for now
// m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", // m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?",
// childAgentUpdate.UUID, cAgentData.SessionID); // childAgentUpdate.UUID, cAgentData.SessionID);
// I can't imagine *yet* why we would get an update if the agent is a root agent.. // I can't imagine *yet* why we would get an update if the agent is a root agent..
// however to avoid a race condition crossing borders.. // however to avoid a race condition crossing borders..
@ -4753,7 +4775,7 @@ namespace OpenSim.Region.Framework.Scenes
#region Script Engine #region Script Engine
private bool ScriptDanger(SceneObjectPart part,Vector3 pos) private bool ScriptDanger(SceneObjectPart part, Vector3 pos)
{ {
ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
if (part != null) if (part != null)
@ -5111,15 +5133,15 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
// Commented pending deletion since this method no longer appears to do anything at all // Commented pending deletion since this method no longer appears to do anything at all
// public bool NeedSceneCacheClear(UUID agentID) // public bool NeedSceneCacheClear(UUID agentID)
// { // {
// IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>(); // IInventoryTransferModule inv = RequestModuleInterface<IInventoryTransferModule>();
// if (inv == null) // if (inv == null)
// return true; // return true;
// //
// return inv.NeedSceneCacheClear(agentID, this); // return inv.NeedSceneCacheClear(agentID, this);
// } // }
public void CleanTempObjects() public void CleanTempObjects()
{ {
@ -5161,7 +5183,7 @@ namespace OpenSim.Region.Framework.Scenes
// 3 = We have seen a new user enter within the past 4 minutes // 3 = We have seen a new user enter within the past 4 minutes
// which can be seen as positive confirmation of sim health // which can be seen as positive confirmation of sim health
// //
int health=1; // Start at 1, means we're up int health = 1; // Start at 1, means we're up
if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) < 1000) if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) < 1000)
health += 1; health += 1;
@ -5175,7 +5197,7 @@ namespace OpenSim.Region.Framework.Scenes
else else
return health; return health;
// CheckHeartbeat(); // CheckHeartbeat();
return health; return health;
} }
@ -5367,14 +5389,14 @@ namespace OpenSim.Region.Framework.Scenes
return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z; return (((vsn.X * xdiff) + (vsn.Y * ydiff)) / (-1 * vsn.Z)) + p0.Z;
} }
// private void CheckHeartbeat() // private void CheckHeartbeat()
// { // {
// if (m_firstHeartbeat) // if (m_firstHeartbeat)
// return; // return;
// //
// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000) // if (Util.EnvironmentTickCountSubtract(m_lastFrameTick) > 2000)
// StartTimer(); // StartTimer();
// } // }
public override ISceneObject DeserializeObject(string representation) public override ISceneObject DeserializeObject(string representation)
{ {
@ -5638,9 +5660,9 @@ namespace OpenSim.Region.Framework.Scenes
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}", // "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ)); // g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
ominX += vec.X; ominX += vec.X;
omaxX += vec.X; omaxX += vec.X;
@ -5779,7 +5801,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} "+ e.StackTrace, e.Message); m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} " + e.StackTrace, e.Message);
reason = "Error authorizing agent: " + e.Message; reason = "Error authorizing agent: " + e.Message;
return false; return false;
} }
@ -5807,7 +5829,7 @@ namespace OpenSim.Region.Framework.Scenes
if (banned) if (banned)
{ {
if(Permissions.IsAdministrator(agentID) == false || Permissions.IsGridGod(agentID) == false) if (Permissions.IsAdministrator(agentID) == false || Permissions.IsGridGod(agentID) == false)
{ {
reason = "No suitable landing point found"; reason = "No suitable landing point found";
return false; return false;
@ -5867,15 +5889,15 @@ namespace OpenSim.Region.Framework.Scenes
if (presence.MovingToTarget) if (presence.MovingToTarget)
{ {
double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget); double distanceToTarget = Util.GetDistanceTo(presence.AbsolutePosition, presence.MoveToPositionTarget);
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}", // "[SCENE]: Abs pos of {0} is {1}, target {2}, distance {3}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget);
// Check the error term of the current position in relation to the target position // Check the error term of the current position in relation to the target position
if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT) if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT)
{ {
// We are close enough to the target // We are close enough to the target
// m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name); // m_log.DebugFormat("[SCENEE]: Stopping autopilot of {0}", presence.Name);
presence.Velocity = Vector3.Zero; presence.Velocity = Vector3.Zero;
presence.AbsolutePosition = presence.MoveToPositionTarget; presence.AbsolutePosition = presence.MoveToPositionTarget;
@ -5894,23 +5916,23 @@ namespace OpenSim.Region.Framework.Scenes
if (presence.LandAtTarget) if (presence.LandAtTarget)
presence.Flying = false; presence.Flying = false;
// Vector3 targetPos = presence.MoveToPositionTarget; // Vector3 targetPos = presence.MoveToPositionTarget;
// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y]; // float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
// if (targetPos.Z - terrainHeight < 0.2) // if (targetPos.Z - terrainHeight < 0.2)
// { // {
// presence.Flying = false; // presence.Flying = false;
// } // }
} }
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}", // "[SCENE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
// presence.AgentControlFlags, presence.MovementFlag, presence.Name); // presence.AgentControlFlags, presence.MovementFlag, presence.Name);
} }
else else
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE]: Updating npc {0} at {1} for next movement to {2}", // "[SCENE]: Updating npc {0} at {1} for next movement to {2}",
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
Vector3 agent_control_v3 = new Vector3(); Vector3 agent_control_v3 = new Vector3();
presence.HandleMoveToTargetUpdate(1, ref agent_control_v3); presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes
// Determines the size of the array that is used to collect StatBlocks // Determines the size of the array that is used to collect StatBlocks
// for sending to the SimStats and SimExtraStatsCollector // for sending to the SimStats and SimExtraStatsCollector
private const int m_statisticArraySize = 26; private const int m_statisticArraySize = 27;
/// <summary> /// <summary>
/// These are the IDs of stats sent in the StatsPacket to the viewer. /// These are the IDs of stats sent in the StatsPacket to the viewer.
@ -109,10 +109,11 @@ namespace OpenSim.Region.Framework.Scenes
SimSpareMs = 32, SimSpareMs = 32,
SimSleepMs = 33, SimSleepMs = 33,
SimIoPumpTime = 34, SimIoPumpTime = 34,
UsersLoggingIn = 35, FrameDilation = 35,
TotalGeoPrim = 36, UsersLoggingIn = 36,
TotalMesh = 37, TotalGeoPrim = 37,
ThreadCount = 38 TotalMesh = 38,
ThreadCount = 39
} }
/// <summary> /// <summary>
@ -348,7 +349,7 @@ namespace OpenSim.Region.Framework.Scenes
double simulationSumFrameTime; double simulationSumFrameTime;
double physicsSumFrameTime; double physicsSumFrameTime;
double networkSumFrameTime; double networkSumFrameTime;
float timeDilation; float frameDilation;
int currentFrame; int currentFrame;
if (!m_scene.Active) if (!m_scene.Active)
@ -466,16 +467,14 @@ namespace OpenSim.Region.Framework.Scenes
else else
currentFrame = m_nextLocation - 1; currentFrame = m_nextLocation - 1;
// Calculate the time dilation; which is currently based on the ratio between the sum of the // Calculate the frame dilation; which is currently based on the ratio between the sum of the
// physics and simulation rate, and the set minimum time to run the scene's update; minFrameTime // physics and simulation rate, and the set minimum time to run a scene's frame
// is given in seconds so multiply by 1000 to convert it to milliseconds frameDilation = (float)(m_simulationFrameTimeMilliseconds[currentFrame] +
timeDilation = (float)(m_simulationFrameTimeMilliseconds[currentFrame] + m_physicsFrameTimeMilliseconds[currentFrame]) / m_scene.MinFrameTicks;
m_physicsFrameTimeMilliseconds[currentFrame]) / (m_scene.MinFrameTime * 1000);
// ORIGINAL code commented out until we have time to add our own // ORIGINAL code commented out until we have time to add our own
sb[0].StatID = (uint) Stats.TimeDilation; sb[0].StatID = (uint) Stats.TimeDilation;
//sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
sb[0].StatValue = timeDilation;
sb[1].StatID = (uint) Stats.SimFPS; sb[1].StatID = (uint) Stats.SimFPS;
sb[1].StatValue = reportedFPS / m_statsUpdateFactor; sb[1].StatValue = reportedFPS / m_statsUpdateFactor;
@ -547,23 +546,26 @@ namespace OpenSim.Region.Framework.Scenes
sb[21].StatID = (uint)Stats.SimSpareMs; sb[21].StatID = (uint)Stats.SimSpareMs;
sb[21].StatValue = m_spareMS / framesUpdated; sb[21].StatValue = m_spareMS / framesUpdated;
// Added to track the number of users currently attempting to // Current ratio between the sum of physics and sim rate, and the
// login to the region // minimum time to run a scene's frame
sb[22].StatID = (uint)Stats.UsersLoggingIn; sb[22].StatID = (uint)Stats.FrameDilation;
sb[22].StatValue = m_usersLoggingIn; sb[22].StatValue = frameDilation;
// Current number of users currently attemptint to login to region
sb[23].StatID = (uint)Stats.UsersLoggingIn;
sb[23].StatValue = m_usersLoggingIn;
// Total number of geometric primitives in the scene // Total number of geometric primitives in the scene
sb[23].StatID = (uint)Stats.TotalGeoPrim; sb[24].StatID = (uint)Stats.TotalGeoPrim;
sb[23].StatValue = m_numGeoPrim; sb[24].StatValue = m_numGeoPrim;
// Total number of mesh objects in the scene // Total number of mesh objects in the scene
sb[24].StatID = (uint)Stats.TotalMesh; sb[25].StatID = (uint)Stats.TotalMesh;
sb[24].StatValue = m_numMesh; sb[25].StatValue = m_numMesh;
// Added to track the current number of threads that XEngine is // Current number of threads that XEngine is using
// using sb[26].StatID = (uint)Stats.ThreadCount;
sb[25].StatID = (uint)Stats.ThreadCount; sb[26].StatValue = m_inUseThreads;
sb[25].StatValue = m_inUseThreads;
for (int i = 0; i < m_statisticArraySize; i++) for (int i = 0; i < m_statisticArraySize; i++)
{ {