From 7d033187d8fd49d9a38531061c38783e81d69f5b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Oct 2011 22:08:56 +0100
Subject: Make reported sim fps more accurate, in line with frame time ms
Also remove some unused fields and improve naming on others.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 26 +++++++++++++------
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 5 ++++
.../Region/Framework/Scenes/SimStatsReporter.cs | 29 ++++++++++------------
3 files changed, 36 insertions(+), 24 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 29a54e8..e4ebcff 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -137,8 +137,6 @@ namespace OpenSim.Region.Framework.Scenes
protected IDialogModule m_dialogModule;
protected IEntityTransferModule m_teleportModule;
protected ICapabilitiesModule m_capsModule;
- // Central Update Loop
- protected int m_fps = 10;
///
/// Current scene frame number
@@ -149,8 +147,20 @@ namespace OpenSim.Region.Framework.Scenes
protected set;
}
- protected float m_timespan = 0.089f;
- protected DateTime m_lastupdate = DateTime.UtcNow;
+ ///
+ /// The minimum length of time in seconds that will be taken for a scene frame. If the frame takes less time then we
+ /// will sleep for the remaining period.
+ ///
+ ///
+ /// One can tweak this number to experiment. One current effect of reducing it is to make avatar animations
+ /// occur too quickly (viewer 1) or with even more slide (viewer 2).
+ ///
+ protected float m_minFrameTimespan = 0.089f;
+
+ ///
+ /// The time of the last frame update.
+ ///
+ protected DateTime m_lastFrameUpdate = DateTime.UtcNow;
// TODO: Possibly stop other classes being able to manipulate this directly.
private SceneGraph m_sceneGraph;
@@ -1211,7 +1221,7 @@ namespace OpenSim.Region.Framework.Scenes
public override void Update()
{
- TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate;
+ TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastFrameUpdate;
float physicsFPS = 0f;
int maintc = Util.EnvironmentTickCount();
@@ -1263,7 +1273,7 @@ namespace OpenSim.Region.Framework.Scenes
if (Frame % m_update_physics == 0)
{
if (m_physics_enabled)
- physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_timespan));
+ physicsFPS = m_sceneGraph.UpdatePhysics(Math.Max(SinceLastFrame.TotalSeconds, m_minFrameTimespan));
if (SynchronizeScene != null)
SynchronizeScene(this);
}
@@ -1379,11 +1389,11 @@ namespace OpenSim.Region.Framework.Scenes
}
finally
{
- m_lastupdate = DateTime.UtcNow;
+ m_lastFrameUpdate = DateTime.UtcNow;
}
maintc = Util.EnvironmentTickCountSubtract(maintc);
- maintc = (int)(m_timespan * 1000) - maintc;
+ maintc = (int)(m_minFrameTimespan * 1000) - maintc;
if (maintc > 0)
Thread.Sleep(maintc);
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 36c5c52..11c2a78 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -174,6 +174,11 @@ namespace OpenSim.Region.Framework.Scenes
});
}
+ ///
+ /// Perform a physics frame update.
+ ///
+ ///
+ ///
protected internal float UpdatePhysics(double elapsed)
{
lock (m_syncRoot)
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 87dcdee..2d92ed8 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -37,6 +37,9 @@ namespace OpenSim.Region.Framework.Scenes
{
public class SimStatsReporter
{
+// private static readonly log4net.ILog m_log
+// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public delegate void SendStatResult(SimStats stats);
public delegate void YourStatsAreWrong();
@@ -165,18 +168,9 @@ namespace OpenSim.Region.Framework.Scenes
#region various statistic googly moogly
- // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
- // 0-50 is pretty close to 0-45
- float simfps = (int) ((m_fps * 5));
// save the reported value so there is something available for llGetRegionFPS
- lastReportedSimFPS = (float)simfps / statsUpdateFactor;
-
- //if (simfps > 45)
- //simfps = simfps - (simfps - 45);
- //if (simfps < 0)
- //simfps = 0;
+ lastReportedSimFPS = (float)m_fps / statsUpdateFactor;
- //
float physfps = ((m_pfps / 1000));
//if (physfps > 600)
@@ -197,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes
// 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change
// values to X-per-second values.
- for (int i = 0; i<21;i++)
+ for (int i = 0; i < 21; i++)
{
sb[i] = new SimStatsPacket.StatBlock();
}
@@ -206,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes
sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
sb[1].StatID = (uint) Stats.SimFPS;
- sb[1].StatValue = simfps/statsUpdateFactor;
+ sb[1].StatValue = m_fps/statsUpdateFactor;
sb[2].StatID = (uint) Stats.PhysicsFPS;
sb[2].StatValue = physfps / statsUpdateFactor;
@@ -272,7 +266,8 @@ namespace OpenSim.Region.Framework.Scenes
SimStats simStats
= new SimStats(
- ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
+ ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity,
+ rb, sb, m_scene.RegionInfo.originRegionID);
handlerSendStatResult = OnSendStatsResult;
if (handlerSendStatResult != null)
@@ -395,30 +390,32 @@ namespace OpenSim.Region.Framework.Scenes
{
m_frameMS += ms;
}
+
public void addNetMS(int ms)
{
m_netMS += ms;
}
+
public void addAgentMS(int ms)
{
m_agentMS += ms;
}
+
public void addPhysicsMS(int ms)
{
m_physicsMS += ms;
}
+
public void addImageMS(int ms)
{
m_imageMS += ms;
}
+
public void addOtherMS(int ms)
{
m_otherMS += ms;
}
-// private static readonly log4net.ILog m_log
-// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
public void AddPendingDownloads(int count)
{
m_pendingDownloads += count;
--
cgit v1.1
From 9090039324ecc45bf1005e719f61a80f0187cb73 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Oct 2011 22:15:28 +0100
Subject: Remove unused local variable i from OdeScene.Simulate()
---
OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 3 ---
1 file changed, 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 6e603e8..2da922b 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -2651,8 +2651,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
//base.TriggerPhysicsBasedRestart();
//}
- int i = 0;
-
// Figure out the Frames Per Second we're going at.
//(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
@@ -2810,7 +2808,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
}
step_time -= ODE_STEPSIZE;
- i++;
//}
//else
//{
--
cgit v1.1
From 604708fc969b92af4f07d4acae9f3d15c7cee63e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Oct 2011 23:31:53 +0100
Subject: Change WebStatsModule to check its config properly, instead of
catching the ineviable NullReferenceException!
Also, tidy up spacing.
---
OpenSim/Region/UserStatistics/WebStatsModule.cs | 41 +++++--------------------
1 file changed, 7 insertions(+), 34 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 3139b8a..fc95189 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -71,21 +71,13 @@ namespace OpenSim.Region.UserStatistics
public virtual void Initialise(Scene scene, IConfigSource config)
{
- IConfig cnfg;
- try
- {
- cnfg = config.Configs["WebStats"];
+ IConfig cnfg = config.Configs["WebStats"];
+
+ if (cnfg != null)
enabled = cnfg.GetBoolean("enabled", false);
- }
- catch (Exception)
- {
- enabled = false;
- }
if (!enabled)
- {
return;
- }
lock (m_scene)
{
@@ -115,16 +107,13 @@ namespace OpenSim.Region.UserStatistics
reports.Add("clients.report", clientReport);
reports.Add("sessions.report", sessionsReport);
-
-
////
// Add Your own Reports here (Do Not Modify Lines here Devs!)
////
////
// End Own reports section
- ////
-
+ ////
MainServer.Instance.AddHTTPHandler("/SStats/", HandleStatsRequest);
MainServer.Instance.AddHTTPHandler("/CAPS/VS/", HandleUnknownCAPSRequest);
@@ -265,7 +254,6 @@ namespace OpenSim.Region.UserStatistics
CreateTables(db);
}
}
-
}
public void CreateTables(SqliteConnection db)
@@ -277,8 +265,6 @@ namespace OpenSim.Region.UserStatistics
createcmd.ExecuteNonQuery();
}
-
-
public virtual void PostInitialise()
{
if (!enabled)
@@ -376,15 +362,11 @@ namespace OpenSim.Region.UserStatistics
}
}
-
-
-
public void OnMakeChildAgent(ScenePresence agent)
{
}
-
public void OnClientClosed(UUID agentID, Scene scene)
{
lock (m_sessions)
@@ -394,7 +376,6 @@ namespace OpenSim.Region.UserStatistics
m_sessions.Remove(agentID);
}
}
-
}
public string readLogLines(int amount)
@@ -433,7 +414,6 @@ namespace OpenSim.Region.UserStatistics
fs.Close();
fs.Dispose();
return encoding.GetString(buffer);
-
}
public UUID GetRegionUUIDFromHandle(ulong regionhandle)
@@ -448,6 +428,7 @@ namespace OpenSim.Region.UserStatistics
}
return UUID.Zero;
}
+
///
/// Callback for a viewerstats cap
///
@@ -523,8 +504,6 @@ namespace OpenSim.Region.UserStatistics
usd = uid.session_data;
-
-
if (message.Type != OSDType.Map)
return new UserSessionID();
@@ -699,7 +678,6 @@ namespace OpenSim.Region.UserStatistics
}
}
-
}
#region SQL
@@ -824,6 +802,7 @@ set session_id=:session_id,
WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key";
#endregion
}
+
public static class UserSessionUtil
{
public static UserSessionData newUserSessionData()
@@ -941,7 +920,6 @@ WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key"
return result / cnt;
}
-
public static float ArrayMode_f(float[] arr)
{
List mode = new List();
@@ -995,10 +973,8 @@ WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key"
}
return mode.ToArray()[0];
-
}
-
public static int ArrayMode_i(int[] arr)
{
List mode = new List();
@@ -1052,7 +1028,6 @@ WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key"
}
return mode.ToArray()[0];
-
}
#endregion
@@ -1178,7 +1153,6 @@ WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key"
public List _sim_fps;
public List _agents_in_view;
}
-
#endregion
@@ -1263,5 +1237,4 @@ WHERE session_id=:session_key AND agent_id=:agent_key AND region_id=:region_key"
m_scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
}
}
-
-}
+}
\ No newline at end of file
--
cgit v1.1
From 8a8983b3d40ba4e38569f4456c6a98d9372c3822 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Oct 2011 23:34:18 +0100
Subject: Add user ID to new estate user prompt, to make it clearer and
consistent with the main create user prompts
---
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index a6b91a3..6fba71e 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -462,7 +462,7 @@ namespace OpenSim
string password = MainConsole.Instance.PasswdPrompt("Password");
string email = MainConsole.Instance.CmdPrompt("Email", "");
- string rawPrincipalId = MainConsole.Instance.CmdPrompt("ID", UUID.Random().ToString());
+ string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
UUID principalId = UUID.Zero;
if (!UUID.TryParse(rawPrincipalId, out principalId))
--
cgit v1.1
From 7fa1c979cf60a981200c4ddc3ea0ff8d0ddb2aa7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 5 Oct 2011 23:36:27 +0100
Subject: rename WebStatsModules.m_scene to m_scenes since it's a list of
scenes, not a single one
---
OpenSim/Region/UserStatistics/WebStatsModule.cs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index fc95189..9d87c45 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.UserStatistics
private static SqliteConnection dbConn;
private Dictionary m_sessions = new Dictionary();
- private List m_scene = new List();
+ private List m_scenes = new List();
private Dictionary reports = new Dictionary();
private Dictionary m_simstatsCounters = new Dictionary();
private const int updateStatsMod = 6;
@@ -79,9 +79,9 @@ namespace OpenSim.Region.UserStatistics
if (!enabled)
return;
- lock (m_scene)
+ lock (m_scenes)
{
- if (m_scene.Count == 0)
+ if (m_scenes.Count == 0)
{
//IConfig startupConfig = config.Configs["Startup"];
@@ -119,7 +119,7 @@ namespace OpenSim.Region.UserStatistics
MainServer.Instance.AddHTTPHandler("/CAPS/VS/", HandleUnknownCAPSRequest);
}
- m_scene.Add(scene);
+ m_scenes.Add(scene);
if (m_simstatsCounters.ContainsKey(scene.RegionInfo.RegionID))
m_simstatsCounters.Remove(scene.RegionInfo.RegionID);
@@ -203,7 +203,7 @@ namespace OpenSim.Region.UserStatistics
repParams["DatabaseConnection"] = dbConn;
- repParams["Scenes"] = m_scene;
+ repParams["Scenes"] = m_scenes;
repParams["SimStats"] = m_simstatsCounters;
repParams["LogLines"] = m_loglines;
repParams["Reports"] = reports;
@@ -283,7 +283,7 @@ namespace OpenSim.Region.UserStatistics
dbConn.Close();
dbConn.Dispose();
m_sessions.Clear();
- m_scene.Clear();
+ m_scenes.Clear();
reports.Clear();
m_simstatsCounters.Clear();
}
@@ -319,10 +319,10 @@ namespace OpenSim.Region.UserStatistics
protected virtual void AddHandlers()
{
- lock (m_scene)
+ lock (m_scenes)
{
- updateLogMod = m_scene.Count * 2;
- foreach (Scene scene in m_scene)
+ updateLogMod = m_scenes.Count * 2;
+ foreach (Scene scene in m_scenes)
{
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
scene.EventManager.OnDeregisterCaps += OnDeRegisterCaps;
@@ -418,9 +418,9 @@ namespace OpenSim.Region.UserStatistics
public UUID GetRegionUUIDFromHandle(ulong regionhandle)
{
- lock (m_scene)
+ lock (m_scenes)
{
- foreach (Scene scene in m_scene)
+ foreach (Scene scene in m_scenes)
{
if (scene.RegionInfo.RegionHandle == regionhandle)
return scene.RegionInfo.RegionID;
--
cgit v1.1
From ca83f99332316fda1c412a5bf2889f9cf5cf3577 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 6 Oct 2011 00:45:25 +0100
Subject: Instead of adding stat agentMS in all kinds of places, calculate it
instead in the main Scene.Update() loop, like the other stats
Some of the places where agentMS was added were in separate threads launched by the update loop. I don't believe this is correct, since such threads are no longer contributing to frame time.
Some of the places were also driven by client input rather than the scene loop. I don't believe it's appropriate to add this kind of stuff to scene loop stats.
These changes hopefully have the nice affect of making the broken out frame stats actually add up to the total frame time
---
OpenSim/Region/Framework/Scenes/Scene.cs | 13 ++++++++-
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 6 ++++
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 32 ++--------------------
.../Region/Framework/Scenes/SimStatsReporter.cs | 6 ----
4 files changed, 21 insertions(+), 36 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e4ebcff..b1755ac 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -183,6 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
// private int m_update_land = 1;
private int m_update_coarse_locations = 50;
+ private int agentMS;
private int frameMS;
private int physicsMS2;
private int physicsMS;
@@ -1226,12 +1227,15 @@ namespace OpenSim.Region.Framework.Scenes
int maintc = Util.EnvironmentTickCount();
int tmpFrameMS = maintc;
- tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0;
+ agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0;
+ // TODO: ADD AGENT TIME HERE
// Increment the frame counter
++Frame;
try
{
+ int tmpAgentMS = Util.EnvironmentTickCount();
+
// Check if any objects have reached their targets
CheckAtTargets();
@@ -1258,6 +1262,8 @@ namespace OpenSim.Region.Framework.Scenes
});
}
+ agentMS = Util.EnvironmentTickCountSubtract(tmpAgentMS);
+
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
if ((Frame % m_update_physics == 0) && m_physics_enabled)
m_sceneGraph.UpdatePreparePhysics();
@@ -1265,7 +1271,11 @@ namespace OpenSim.Region.Framework.Scenes
// Apply any pending avatar force input to the avatar's velocity
if (Frame % m_update_entitymovement == 0)
+ {
+ tmpAgentMS = Util.EnvironmentTickCount();
m_sceneGraph.UpdateScenePresenceMovement();
+ agentMS += Util.EnvironmentTickCountSubtract(tmpAgentMS);
+ }
// Perform the main physics update. This will do the actual work of moving objects and avatars according to their
// velocity
@@ -1330,6 +1340,7 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
StatsReporter.addFrameMS(frameMS);
+ StatsReporter.addAgentMS(agentMS);
StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
StatsReporter.addOtherMS(otherMS);
StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 11c2a78..caec704 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -166,6 +166,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Update the position of all the scene presences.
+ ///
+ ///
+ /// Called only from the main scene loop.
+ ///
protected internal void UpdatePresences()
{
ForEachScenePresence(delegate(ScenePresence presence)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b3e04be..f049b78 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -847,11 +847,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendPrimUpdates()
{
- m_perfMonMS = Util.EnvironmentTickCount();
-
m_sceneViewer.SendPrimUpdates();
-
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
#region Status Methods
@@ -1253,7 +1249,7 @@ namespace OpenSim.Region.Framework.Scenes
// return;
//}
- m_perfMonMS = Util.EnvironmentTickCount();
+// m_perfMonMS = Util.EnvironmentTickCount();
++m_movementUpdateCount;
if (m_movementUpdateCount < 1)
@@ -1545,7 +1541,8 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.EventManager.TriggerOnClientMovement(this);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
+ // It doesn't make sense to add this to frame stats as this update is processed indepedently of the scene loop
+// m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
@@ -2325,8 +2322,6 @@ namespace OpenSim.Region.Framework.Scenes
/// The vector in which to move. This is relative to the rotation argument
public void AddNewMovement(Vector3 vec)
{
- m_perfMonMS = Util.EnvironmentTickCount();
-
Vector3 direc = vec * Rotation;
direc.Normalize();
@@ -2365,8 +2360,6 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Add the force instead of only setting it to support multiple forces per frame?
m_forceToApply = direc;
-
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
#endregion
@@ -2431,8 +2424,6 @@ namespace OpenSim.Region.Framework.Scenes
// server.
if (remoteClient.IsActive)
{
- m_perfMonMS = Util.EnvironmentTickCount();
-
Vector3 pos = m_pos;
pos.Z += m_appearance.HipOffset;
@@ -2443,7 +2434,6 @@ namespace OpenSim.Region.Framework.Scenes
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
m_scene.StatsReporter.AddAgentUpdates(1);
}
}
@@ -2484,14 +2474,11 @@ namespace OpenSim.Region.Framework.Scenes
|| Math.Abs(distanceError) > distanceErrorThreshold
|| velocidyDiff > 0.01f) // did velocity change from last update?
{
- m_perfMonMS = currentTick;
lastVelocitySentToAllClients = Velocity;
lastTerseUpdateToAllClientsTick = currentTick;
lastPositionSentToAllClients = OffsetPosition;
m_scene.ForEachClient(SendTerseUpdateToClient);
-
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
}
@@ -2512,9 +2499,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List coarseLocations, List avatarUUIDs)
{
- m_perfMonMS = Util.EnvironmentTickCount();
m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
@@ -2575,8 +2560,6 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent");
return;
}
-
- m_perfMonMS = Util.EnvironmentTickCount();
int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -2586,7 +2569,6 @@ namespace OpenSim.Region.Framework.Scenes
});
m_scene.StatsReporter.AddAgentUpdates(count);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
@@ -2595,8 +2577,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendOtherAgentsAvatarDataToMe()
{
- m_perfMonMS = Util.EnvironmentTickCount();
-
int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
{
@@ -2613,7 +2593,6 @@ namespace OpenSim.Region.Framework.Scenes
});
m_scene.StatsReporter.AddAgentUpdates(count);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
@@ -2642,8 +2621,6 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent");
return;
}
-
- m_perfMonMS = Util.EnvironmentTickCount();
int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -2656,7 +2633,6 @@ namespace OpenSim.Region.Framework.Scenes
});
m_scene.StatsReporter.AddAgentUpdates(count);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
@@ -2666,7 +2642,6 @@ namespace OpenSim.Region.Framework.Scenes
public void SendOtherAgentsAppearanceToMe()
{
//m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID);
- m_perfMonMS = Util.EnvironmentTickCount();
int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -2684,7 +2659,6 @@ namespace OpenSim.Region.Framework.Scenes
});
m_scene.StatsReporter.AddAgentUpdates(count);
- m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 2d92ed8..282b677 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -452,12 +452,6 @@ namespace OpenSim.Region.Framework.Scenes
AddOutPackets(outPackets);
AddunAckedBytes(unAckedBytes);
}
-
- public void AddAgentTime(int ms)
- {
- addFrameMS(ms);
- addAgentMS(ms);
- }
#endregion
}
--
cgit v1.1