aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-01 03:23:19 +0100
committerJustin Clark-Casey (justincc)2012-06-01 03:23:19 +0100
commitd34b84b53137f5516f790563588676ac5fbf0e49 (patch)
tree943789fee0cf906df482e766c3e89847b9e7fa20 /OpenSim/Region/Physics
parentCollection optional avatar and prim taint frame millisecond times (diff)
downloadopensim-SC-d34b84b53137f5516f790563588676ac5fbf0e49.zip
opensim-SC-d34b84b53137f5516f790563588676ac5fbf0e49.tar.gz
opensim-SC-d34b84b53137f5516f790563588676ac5fbf0e49.tar.bz2
opensim-SC-d34b84b53137f5516f790563588676ac5fbf0e49.tar.xz
Add avatar forces calculation, prim force and raycasting per frame millisecond optional stats
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs53
1 files changed, 46 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 63b999e..e44375b 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -151,17 +151,32 @@ 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 154 /// Stat name for time spent processing avatar taints per frame
155 /// </summary> 155 /// </summary>
156 public const string ODEAvatarTaintMsStatName = "ODEAvatarTaintFrameMS"; 156 public const string ODEAvatarTaintMsStatName = "ODEAvatarTaintFrameMS";
157 157
158 /// <summary> 158 /// <summary>
159 /// Stat name for amount of time spent processing prim taints per frame 159 /// Stat name for time spent processing prim taints per frame
160 /// </summary> 160 /// </summary>
161 public const string ODEPrimTaintMsStatName = "ODEPrimTaintFrameMS"; 161 public const string ODEPrimTaintMsStatName = "ODEPrimTaintFrameMS";
162 162
163 /// <summary> 163 /// <summary>
164 /// Stat name for the amount of time spent in native code that actually steps through the simulation. 164 /// Stat name for time spent calculating avatar forces per frame.
165 /// </summary>
166 public const string ODEAvatarForcesFrameMsStatName = "ODEAvatarForcesFrameMS";
167
168 /// <summary>
169 /// Stat name for time spent calculating prim forces per frame
170 /// </summary>
171 public const string ODEPrimForcesFrameMsStatName = "ODEPrimForcesFrameMS";
172
173 /// <summary>
174 /// Stat name for time spent fulfilling raycasting requests per frame
175 /// </summary>
176 public const string ODERaycastingFrameMsStatName = "ODERaycastingFrameMS";
177
178 /// <summary>
179 /// Stat name for time spent in native code that actually steps through the simulation.
165 /// </summary> 180 /// </summary>
166 public const string ODENativeStepFrameMsStatName = "ODENativeStepFrameMS"; 181 public const string ODENativeStepFrameMsStatName = "ODENativeStepFrameMS";
167 182
@@ -171,7 +186,7 @@ namespace OpenSim.Region.Physics.OdePlugin
171 public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS"; 186 public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS";
172 187
173 /// <summary> 188 /// <summary>
174 /// Stat name for the number of milliseconds that ODE spends in native geom collision code. 189 /// Stat name for milliseconds that ODE spends in native geom collision code.
175 /// </summary> 190 /// </summary>
176 public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS"; 191 public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS";
177 192
@@ -181,7 +196,7 @@ namespace OpenSim.Region.Physics.OdePlugin
181 public const string ODECollisionNotificationFrameMsStatName = "ODECollisionNotificationFrameMS"; 196 public const string ODECollisionNotificationFrameMsStatName = "ODECollisionNotificationFrameMS";
182 197
183 /// <summary> 198 /// <summary>
184 /// Stat name for the milliseconds spent updating avatar position and velocity 199 /// Stat name for milliseconds spent updating avatar position and velocity
185 /// </summary> 200 /// </summary>
186 public const string ODEAvatarUpdateFrameMsStatName = "ODEAvatarUpdateFrameMS"; 201 public const string ODEAvatarUpdateFrameMsStatName = "ODEAvatarUpdateFrameMS";
187 202
@@ -191,12 +206,12 @@ namespace OpenSim.Region.Physics.OdePlugin
191 public const string ODEPrimUpdateFrameMsStatName = "ODEPrimUpdateFrameMS"; 206 public const string ODEPrimUpdateFrameMsStatName = "ODEPrimUpdateFrameMS";
192 207
193 /// <summary> 208 /// <summary>
194 /// Stat name for the number of avatar collisions with another entity. 209 /// Stat name for avatar collisions with another entity.
195 /// </summary> 210 /// </summary>
196 public const string ODEAvatarContactsStatsName = "ODEAvatarContacts"; 211 public const string ODEAvatarContactsStatsName = "ODEAvatarContacts";
197 212
198 /// <summary> 213 /// <summary>
199 /// Stat name for the number of prim collisions with another entity. 214 /// Stat name for prim collisions with another entity.
200 /// </summary> 215 /// </summary>
201 public const string ODEPrimContactsStatName = "ODEPrimContacts"; 216 public const string ODEPrimContactsStatName = "ODEPrimContacts";
202 217
@@ -3010,6 +3025,13 @@ namespace OpenSim.Region.Physics.OdePlugin
3010 defects.Clear(); 3025 defects.Clear();
3011 } 3026 }
3012 3027
3028 if (CollectStats)
3029 {
3030 tempTick2 = Util.EnvironmentTickCount();
3031 m_stats[ODEAvatarForcesFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
3032 tempTick = tempTick2;
3033 }
3034
3013 // Move other active objects 3035 // Move other active objects
3014 foreach (OdePrim prim in _activeprims) 3036 foreach (OdePrim prim in _activeprims)
3015 { 3037 {
@@ -3017,12 +3039,26 @@ namespace OpenSim.Region.Physics.OdePlugin
3017 prim.Move(timeStep); 3039 prim.Move(timeStep);
3018 } 3040 }
3019 3041
3042 if (CollectStats)
3043 {
3044 tempTick2 = Util.EnvironmentTickCount();
3045 m_stats[ODEPrimForcesFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
3046 tempTick = tempTick2;
3047 }
3048
3020 //if ((framecount % m_randomizeWater) == 0) 3049 //if ((framecount % m_randomizeWater) == 0)
3021 // randomizeWater(waterlevel); 3050 // randomizeWater(waterlevel);
3022 3051
3023 //int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); 3052 //int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests();
3024 m_rayCastManager.ProcessQueuedRequests(); 3053 m_rayCastManager.ProcessQueuedRequests();
3025 3054
3055 if (CollectStats)
3056 {
3057 tempTick2 = Util.EnvironmentTickCount();
3058 m_stats[ODERaycastingFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
3059 tempTick = tempTick2;
3060 }
3061
3026 collision_optimized(); 3062 collision_optimized();
3027 3063
3028 if (CollectStats) 3064 if (CollectStats)
@@ -4182,6 +4218,9 @@ namespace OpenSim.Region.Physics.OdePlugin
4182 m_stats[ODETotalFrameMsStatName] = 0; 4218 m_stats[ODETotalFrameMsStatName] = 0;
4183 m_stats[ODEAvatarTaintMsStatName] = 0; 4219 m_stats[ODEAvatarTaintMsStatName] = 0;
4184 m_stats[ODEPrimTaintMsStatName] = 0; 4220 m_stats[ODEPrimTaintMsStatName] = 0;
4221 m_stats[ODEAvatarForcesFrameMsStatName] = 0;
4222 m_stats[ODEPrimForcesFrameMsStatName] = 0;
4223 m_stats[ODERaycastingFrameMsStatName] = 0;
4185 m_stats[ODENativeStepFrameMsStatName] = 0; 4224 m_stats[ODENativeStepFrameMsStatName] = 0;
4186 m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0; 4225 m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0;
4187 m_stats[ODENativeGeomCollisionFrameMsStatName] = 0; 4226 m_stats[ODENativeGeomCollisionFrameMsStatName] = 0;