aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2011-10-12 01:42:39 +0100
committerMelanie2011-10-12 01:42:39 +0100
commit4e88fe42e4b5da8702f61a74bddd59865c7bd32f (patch)
tree7e14136b1e604ff138a28496ff5373160a58fe91
parentMerge commit '7fa1c979cf60a981200c4ddc3ea0ff8d0ddb2aa7' into bigmerge (diff)
parentInstead of adding stat agentMS in all kinds of places, calculate it instead i... (diff)
downloadopensim-SC_OLD-4e88fe42e4b5da8702f61a74bddd59865c7bd32f.zip
opensim-SC_OLD-4e88fe42e4b5da8702f61a74bddd59865c7bd32f.tar.gz
opensim-SC_OLD-4e88fe42e4b5da8702f61a74bddd59865c7bd32f.tar.bz2
opensim-SC_OLD-4e88fe42e4b5da8702f61a74bddd59865c7bd32f.tar.xz
Merge commit 'ca83f99332316fda1c412a5bf2889f9cf5cf3577' into bigmerge
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs32
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs6
4 files changed, 21 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1acd607..cd4b14d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -186,6 +186,7 @@ namespace OpenSim.Region.Framework.Scenes
186 private int m_update_land = 10; 186 private int m_update_land = 10;
187 private int m_update_coarse_locations = 50; 187 private int m_update_coarse_locations = 50;
188 188
189 private int agentMS;
189 private int frameMS; 190 private int frameMS;
190 private int physicsMS2; 191 private int physicsMS2;
191 private int physicsMS; 192 private int physicsMS;
@@ -1251,12 +1252,15 @@ namespace OpenSim.Region.Framework.Scenes
1251 1252
1252 int maintc = Util.EnvironmentTickCount(); 1253 int maintc = Util.EnvironmentTickCount();
1253 int tmpFrameMS = maintc; 1254 int tmpFrameMS = maintc;
1254 tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0; 1255 agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0;
1255 1256
1257 // TODO: ADD AGENT TIME HERE
1256 // Increment the frame counter 1258 // Increment the frame counter
1257 ++Frame; 1259 ++Frame;
1258 try 1260 try
1259 { 1261 {
1262 int tmpAgentMS = Util.EnvironmentTickCount();
1263
1260 // Check if any objects have reached their targets 1264 // Check if any objects have reached their targets
1261 CheckAtTargets(); 1265 CheckAtTargets();
1262 1266
@@ -1283,6 +1287,8 @@ namespace OpenSim.Region.Framework.Scenes
1283 }); 1287 });
1284 } 1288 }
1285 1289
1290 agentMS = Util.EnvironmentTickCountSubtract(tmpAgentMS);
1291
1286 int tmpPhysicsMS2 = Util.EnvironmentTickCount(); 1292 int tmpPhysicsMS2 = Util.EnvironmentTickCount();
1287 if ((Frame % m_update_physics == 0) && m_physics_enabled) 1293 if ((Frame % m_update_physics == 0) && m_physics_enabled)
1288 m_sceneGraph.UpdatePreparePhysics(); 1294 m_sceneGraph.UpdatePreparePhysics();
@@ -1290,7 +1296,11 @@ namespace OpenSim.Region.Framework.Scenes
1290 1296
1291 // Apply any pending avatar force input to the avatar's velocity 1297 // Apply any pending avatar force input to the avatar's velocity
1292 if (Frame % m_update_entitymovement == 0) 1298 if (Frame % m_update_entitymovement == 0)
1299 {
1300 tmpAgentMS = Util.EnvironmentTickCount();
1293 m_sceneGraph.UpdateScenePresenceMovement(); 1301 m_sceneGraph.UpdateScenePresenceMovement();
1302 agentMS += Util.EnvironmentTickCountSubtract(tmpAgentMS);
1303 }
1294 1304
1295 // Perform the main physics update. This will do the actual work of moving objects and avatars according to their 1305 // Perform the main physics update. This will do the actual work of moving objects and avatars according to their
1296 // velocity 1306 // velocity
@@ -1362,6 +1372,7 @@ namespace OpenSim.Region.Framework.Scenes
1362 StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount()); 1372 StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
1363 StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount()); 1373 StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
1364 StatsReporter.addFrameMS(frameMS); 1374 StatsReporter.addFrameMS(frameMS);
1375 StatsReporter.addAgentMS(agentMS);
1365 StatsReporter.addPhysicsMS(physicsMS + physicsMS2); 1376 StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
1366 StatsReporter.addOtherMS(otherMS); 1377 StatsReporter.addOtherMS(otherMS);
1367 StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); 1378 StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index afa6e89..13668ab 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -180,6 +180,12 @@ namespace OpenSim.Region.Framework.Scenes
180 } 180 }
181 } 181 }
182 182
183 /// <summary>
184 /// Update the position of all the scene presences.
185 /// </summary>
186 /// <remarks>
187 /// Called only from the main scene loop.
188 /// </remarks>
183 protected internal void UpdatePresences() 189 protected internal void UpdatePresences()
184 { 190 {
185 ForEachScenePresence(delegate(ScenePresence presence) 191 ForEachScenePresence(delegate(ScenePresence presence)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index dee9bc3..35f5566 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -929,11 +929,7 @@ namespace OpenSim.Region.Framework.Scenes
929 /// </summary> 929 /// </summary>
930 public void SendPrimUpdates() 930 public void SendPrimUpdates()
931 { 931 {
932 m_perfMonMS = Util.EnvironmentTickCount();
933
934 m_sceneViewer.SendPrimUpdates(); 932 m_sceneViewer.SendPrimUpdates();
935
936 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
937 } 933 }
938 934
939 #region Status Methods 935 #region Status Methods
@@ -1401,7 +1397,7 @@ namespace OpenSim.Region.Framework.Scenes
1401 // return; 1397 // return;
1402 //} 1398 //}
1403 1399
1404 m_perfMonMS = Util.EnvironmentTickCount(); 1400// m_perfMonMS = Util.EnvironmentTickCount();
1405 1401
1406 ++m_movementUpdateCount; 1402 ++m_movementUpdateCount;
1407 if (m_movementUpdateCount < 1) 1403 if (m_movementUpdateCount < 1)
@@ -1693,7 +1689,8 @@ namespace OpenSim.Region.Framework.Scenes
1693 1689
1694 m_scene.EventManager.TriggerOnClientMovement(this); 1690 m_scene.EventManager.TriggerOnClientMovement(this);
1695 1691
1696 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 1692 // It doesn't make sense to add this to frame stats as this update is processed indepedently of the scene loop
1693// m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
1697 } 1694 }
1698 1695
1699 /// <summary> 1696 /// <summary>
@@ -2670,8 +2667,6 @@ namespace OpenSim.Region.Framework.Scenes
2670 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param> 2667 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
2671 public void AddNewMovement(Vector3 vec) 2668 public void AddNewMovement(Vector3 vec)
2672 { 2669 {
2673 m_perfMonMS = Util.EnvironmentTickCount();
2674
2675 Vector3 direc = vec * Rotation; 2670 Vector3 direc = vec * Rotation;
2676 direc.Normalize(); 2671 direc.Normalize();
2677 2672
@@ -2710,8 +2705,6 @@ namespace OpenSim.Region.Framework.Scenes
2710 2705
2711 // TODO: Add the force instead of only setting it to support multiple forces per frame? 2706 // TODO: Add the force instead of only setting it to support multiple forces per frame?
2712 m_forceToApply = direc; 2707 m_forceToApply = direc;
2713
2714 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2715 } 2708 }
2716 2709
2717 #endregion 2710 #endregion
@@ -2779,8 +2772,6 @@ namespace OpenSim.Region.Framework.Scenes
2779 // server. 2772 // server.
2780 if (remoteClient.IsActive) 2773 if (remoteClient.IsActive)
2781 { 2774 {
2782 m_perfMonMS = Util.EnvironmentTickCount();
2783
2784 Vector3 pos = m_pos; 2775 Vector3 pos = m_pos;
2785 pos.Z += m_appearance.HipOffset; 2776 pos.Z += m_appearance.HipOffset;
2786 2777
@@ -2791,7 +2782,6 @@ namespace OpenSim.Region.Framework.Scenes
2791 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity 2782 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
2792 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); 2783 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
2793 2784
2794 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2795 m_scene.StatsReporter.AddAgentUpdates(1); 2785 m_scene.StatsReporter.AddAgentUpdates(1);
2796 } 2786 }
2797 } 2787 }
@@ -2832,14 +2822,11 @@ namespace OpenSim.Region.Framework.Scenes
2832 || Math.Abs(distanceError) > distanceErrorThreshold 2822 || Math.Abs(distanceError) > distanceErrorThreshold
2833 || velocidyDiff > 0.01f) // did velocity change from last update? 2823 || velocidyDiff > 0.01f) // did velocity change from last update?
2834 { 2824 {
2835 m_perfMonMS = currentTick;
2836 lastVelocitySentToAllClients = Velocity; 2825 lastVelocitySentToAllClients = Velocity;
2837 lastTerseUpdateToAllClientsTick = currentTick; 2826 lastTerseUpdateToAllClientsTick = currentTick;
2838 lastPositionSentToAllClients = OffsetPosition; 2827 lastPositionSentToAllClients = OffsetPosition;
2839 2828
2840 m_scene.ForEachClient(SendTerseUpdateToClient); 2829 m_scene.ForEachClient(SendTerseUpdateToClient);
2841
2842 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2843 } 2830 }
2844 } 2831 }
2845 2832
@@ -2860,9 +2847,7 @@ namespace OpenSim.Region.Framework.Scenes
2860 2847
2861 public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) 2848 public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
2862 { 2849 {
2863 m_perfMonMS = Util.EnvironmentTickCount();
2864 m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); 2850 m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations);
2865 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2866 } 2851 }
2867 2852
2868 /// <summary> 2853 /// <summary>
@@ -2923,8 +2908,6 @@ namespace OpenSim.Region.Framework.Scenes
2923 m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent"); 2908 m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent");
2924 return; 2909 return;
2925 } 2910 }
2926
2927 m_perfMonMS = Util.EnvironmentTickCount();
2928 2911
2929 int count = 0; 2912 int count = 0;
2930 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2913 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -2934,7 +2917,6 @@ namespace OpenSim.Region.Framework.Scenes
2934 }); 2917 });
2935 2918
2936 m_scene.StatsReporter.AddAgentUpdates(count); 2919 m_scene.StatsReporter.AddAgentUpdates(count);
2937 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2938 } 2920 }
2939 2921
2940 /// <summary> 2922 /// <summary>
@@ -2943,8 +2925,6 @@ namespace OpenSim.Region.Framework.Scenes
2943 /// </summary> 2925 /// </summary>
2944 public void SendOtherAgentsAvatarDataToMe() 2926 public void SendOtherAgentsAvatarDataToMe()
2945 { 2927 {
2946 m_perfMonMS = Util.EnvironmentTickCount();
2947
2948 int count = 0; 2928 int count = 0;
2949 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2929 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
2950 { 2930 {
@@ -2961,7 +2941,6 @@ namespace OpenSim.Region.Framework.Scenes
2961 }); 2941 });
2962 2942
2963 m_scene.StatsReporter.AddAgentUpdates(count); 2943 m_scene.StatsReporter.AddAgentUpdates(count);
2964 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2965 } 2944 }
2966 2945
2967 /// <summary> 2946 /// <summary>
@@ -2990,8 +2969,6 @@ namespace OpenSim.Region.Framework.Scenes
2990 m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent"); 2969 m_log.Warn("[SCENE PRESENCE] attempt to send avatar data from a child agent");
2991 return; 2970 return;
2992 } 2971 }
2993
2994 m_perfMonMS = Util.EnvironmentTickCount();
2995 2972
2996 int count = 0; 2973 int count = 0;
2997 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2974 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -3004,7 +2981,6 @@ namespace OpenSim.Region.Framework.Scenes
3004 }); 2981 });
3005 2982
3006 m_scene.StatsReporter.AddAgentUpdates(count); 2983 m_scene.StatsReporter.AddAgentUpdates(count);
3007 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
3008 } 2984 }
3009 2985
3010 /// <summary> 2986 /// <summary>
@@ -3014,7 +2990,6 @@ namespace OpenSim.Region.Framework.Scenes
3014 public void SendOtherAgentsAppearanceToMe() 2990 public void SendOtherAgentsAppearanceToMe()
3015 { 2991 {
3016 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); 2992 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID);
3017 m_perfMonMS = Util.EnvironmentTickCount();
3018 2993
3019 int count = 0; 2994 int count = 0;
3020 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 2995 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
@@ -3032,7 +3007,6 @@ namespace OpenSim.Region.Framework.Scenes
3032 }); 3007 });
3033 3008
3034 m_scene.StatsReporter.AddAgentUpdates(count); 3009 m_scene.StatsReporter.AddAgentUpdates(count);
3035 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
3036 } 3010 }
3037 3011
3038 /// <summary> 3012 /// <summary>
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
452 AddOutPackets(outPackets); 452 AddOutPackets(outPackets);
453 AddunAckedBytes(unAckedBytes); 453 AddunAckedBytes(unAckedBytes);
454 } 454 }
455
456 public void AddAgentTime(int ms)
457 {
458 addFrameMS(ms);
459 addAgentMS(ms);
460 }
461 455
462 #endregion 456 #endregion
463 } 457 }