From 200376b3c4717e9ae00b67ef5f2a57383952f2d5 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 1 Jun 2012 03:49:42 +0100
Subject: Add optional stat for the other collision time per frame not spent in
ODE native spaces or geom collision code
---
OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index e44375b..8590453 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -191,6 +191,11 @@ namespace OpenSim.Region.Physics.OdePlugin
public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS";
///
+ /// Time spent in collision processing that is not spent in native space or geom collision code.
+ ///
+ public const string ODEOtherCollisionFrameMsStatName = "ODEOtherCollisionFrameMS";
+
+ ///
/// Stat name for time spent notifying listeners of collisions
///
public const string ODECollisionNotificationFrameMsStatName = "ODECollisionNotificationFrameMS";
@@ -3062,7 +3067,11 @@ namespace OpenSim.Region.Physics.OdePlugin
collision_optimized();
if (CollectStats)
- tempTick = Util.EnvironmentTickCount();
+ {
+ tempTick2 = Util.EnvironmentTickCount();
+ m_stats[ODEOtherCollisionFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick2, tempTick);
+ tempTick = tempTick2;
+ }
foreach (PhysicsActor obj in _collisionEventPrim.Values)
{
@@ -4210,6 +4219,11 @@ namespace OpenSim.Region.Physics.OdePlugin
InitializeExtraStats();
}
+ returnStats[ODEOtherCollisionFrameMsStatName]
+ = returnStats[ODEOtherCollisionFrameMsStatName]
+ - returnStats[ODENativeSpaceCollisionFrameMsStatName]
+ - returnStats[ODENativeGeomCollisionFrameMsStatName];
+
return returnStats;
}
@@ -4224,6 +4238,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_stats[ODENativeStepFrameMsStatName] = 0;
m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0;
m_stats[ODENativeGeomCollisionFrameMsStatName] = 0;
+ m_stats[ODEOtherCollisionFrameMsStatName] = 0;
m_stats[ODECollisionNotificationFrameMsStatName] = 0;
m_stats[ODEAvatarContactsStatsName] = 0;
m_stats[ODEPrimContactsStatName] = 0;
--
cgit v1.1