aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs43
1 files changed, 36 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 948930b..63b999e 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -151,6 +151,16 @@ namespace OpenSim.Region.Physics.OdePlugin
151 public const string ODETotalFrameMsStatName = "ODETotalFrameMS"; 151 public const string ODETotalFrameMsStatName = "ODETotalFrameMS";
152 152
153 /// <summary> 153 /// <summary>
154 /// Stat name for amount of time spent processing avatar taints per frame
155 /// </summary>
156 public const string ODEAvatarTaintMsStatName = "ODEAvatarTaintFrameMS";
157
158 /// <summary>
159 /// Stat name for amount of time spent processing prim taints per frame
160 /// </summary>
161 public const string ODEPrimTaintMsStatName = "ODEPrimTaintFrameMS";
162
163 /// <summary>
154 /// Stat name for the amount of time spent in native code that actually steps through the simulation. 164 /// Stat name for the amount of time spent in native code that actually steps through the simulation.
155 /// </summary> 165 /// </summary>
156 public const string ODENativeStepFrameMsStatName = "ODENativeStepFrameMS"; 166 public const string ODENativeStepFrameMsStatName = "ODENativeStepFrameMS";
@@ -2848,7 +2858,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2848 public override float Simulate(float timeStep) 2858 public override float Simulate(float timeStep)
2849 { 2859 {
2850 int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0; 2860 int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0;
2851 int tempTick = 0;; 2861 int tempTick = 0, tempTick2 = 0;
2852 2862
2853 if (framecount >= int.MaxValue) 2863 if (framecount >= int.MaxValue)
2854 framecount = 0; 2864 framecount = 0;
@@ -2926,6 +2936,9 @@ namespace OpenSim.Region.Physics.OdePlugin
2926 { 2936 {
2927 try 2937 try
2928 { 2938 {
2939 if (CollectStats)
2940 tempTick = Util.EnvironmentTickCount();
2941
2929 lock (_taintedActors) 2942 lock (_taintedActors)
2930 { 2943 {
2931 foreach (OdeCharacter character in _taintedActors) 2944 foreach (OdeCharacter character in _taintedActors)
@@ -2934,6 +2947,13 @@ namespace OpenSim.Region.Physics.OdePlugin
2934 _taintedActors.Clear(); 2947 _taintedActors.Clear();
2935 } 2948 }
2936 2949
2950 if (CollectStats)
2951 {
2952 tempTick2 = Util.EnvironmentTickCount();
2953 m_stats[ODEAvatarTaintMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
2954 tempTick = tempTick2;
2955 }
2956
2937 lock (_taintedPrims) 2957 lock (_taintedPrims)
2938 { 2958 {
2939 foreach (OdePrim prim in _taintedPrims) 2959 foreach (OdePrim prim in _taintedPrims)
@@ -2964,6 +2984,13 @@ namespace OpenSim.Region.Physics.OdePlugin
2964 _taintedPrims.Clear(); 2984 _taintedPrims.Clear();
2965 } 2985 }
2966 2986
2987 if (CollectStats)
2988 {
2989 tempTick2 = Util.EnvironmentTickCount();
2990 m_stats[ODEPrimTaintMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
2991 tempTick = tempTick2;
2992 }
2993
2967 // Move characters 2994 // Move characters
2968 foreach (OdeCharacter actor in _characters) 2995 foreach (OdeCharacter actor in _characters)
2969 actor.Move(defects); 2996 actor.Move(defects);
@@ -3028,10 +3055,9 @@ namespace OpenSim.Region.Physics.OdePlugin
3028 3055
3029 if (CollectStats) 3056 if (CollectStats)
3030 { 3057 {
3031 m_stats[ODECollisionNotificationFrameMsStatName] 3058 tempTick2 = Util.EnvironmentTickCount();
3032 += Util.EnvironmentTickCountSubtract(tempTick); 3059 m_stats[ODECollisionNotificationFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
3033 3060 tempTick = tempTick2;
3034 tempTick = Util.EnvironmentTickCount();
3035 } 3061 }
3036 3062
3037 d.WorldQuickStep(world, ODE_STEPSIZE); 3063 d.WorldQuickStep(world, ODE_STEPSIZE);
@@ -3077,8 +3103,9 @@ namespace OpenSim.Region.Physics.OdePlugin
3077 3103
3078 if (CollectStats) 3104 if (CollectStats)
3079 { 3105 {
3080 m_stats[ODEAvatarUpdateFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick); 3106 tempTick2 = Util.EnvironmentTickCount();
3081 tempTick = Util.EnvironmentTickCount(); 3107 m_stats[ODEAvatarUpdateFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
3108 tempTick = tempTick2;
3082 } 3109 }
3083 3110
3084 //if (timeStep < 0.2f) 3111 //if (timeStep < 0.2f)
@@ -4153,6 +4180,8 @@ namespace OpenSim.Region.Physics.OdePlugin
4153 private void InitializeExtraStats() 4180 private void InitializeExtraStats()
4154 { 4181 {
4155 m_stats[ODETotalFrameMsStatName] = 0; 4182 m_stats[ODETotalFrameMsStatName] = 0;
4183 m_stats[ODEAvatarTaintMsStatName] = 0;
4184 m_stats[ODEPrimTaintMsStatName] = 0;
4156 m_stats[ODENativeStepFrameMsStatName] = 0; 4185 m_stats[ODENativeStepFrameMsStatName] = 0;
4157 m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0; 4186 m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0;
4158 m_stats[ODENativeGeomCollisionFrameMsStatName] = 0; 4187 m_stats[ODENativeGeomCollisionFrameMsStatName] = 0;