From 8333b928fa3353304358ed55293b52478a39ab6e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 1 Jun 2012 01:27:19 +0100 Subject: Break down native ODE collision frame time stat into native space collision and geom collision stats --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 32dac22..d4c0b85 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -148,6 +148,16 @@ namespace OpenSim.Region.Physics.OdePlugin public const string ODENativeCollisionFrameMsStatName = "ODENativeCollisionFrameMS"; /// + /// Stat name for recording the number of milliseconds that ODE spends in native space collision code. + /// + public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS"; + + /// + /// Stat name for recording the number of milliseconds that ODE spends in native geom collision code. + /// + public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS"; + + /// /// Stat name for the number of avatar collisions with another entity. /// public const string ODEAvatarContactsStatsName = "ODEAvatarContacts"; @@ -843,7 +853,7 @@ namespace OpenSim.Region.Physics.OdePlugin // We do this outside the lock so that any waiting threads aren't held up, though the effect is probably // negligable if (CollectStats) - m_stats[ODENativeCollisionFrameMsStatName] + m_stats[ODENativeGeomCollisionFrameMsStatName] += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); return count; @@ -867,7 +877,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (CollectStats && m_inCollisionTiming) { - m_stats[ODENativeCollisionFrameMsStatName] + m_stats[ODENativeSpaceCollisionFrameMsStatName] += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); m_inCollisionTiming = false; } @@ -883,7 +893,7 @@ namespace OpenSim.Region.Physics.OdePlugin { if (CollectStats && m_inCollisionTiming) { - m_stats[ODENativeCollisionFrameMsStatName] + m_stats[ODENativeSpaceCollisionFrameMsStatName] += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); m_inCollisionTiming = false; } @@ -4079,6 +4089,10 @@ namespace OpenSim.Region.Physics.OdePlugin lock (OdeLock) { returnStats = new Dictionary(m_stats); + + returnStats[ODENativeCollisionFrameMsStatName] + = returnStats[ODENativeSpaceCollisionFrameMsStatName] + + returnStats[ODENativeGeomCollisionFrameMsStatName]; InitializeExtraStats(); } @@ -4088,7 +4102,11 @@ namespace OpenSim.Region.Physics.OdePlugin private void InitializeExtraStats() { - m_stats[ODENativeCollisionFrameMsStatName] = 0; + // No need to zero since this is calculated by addition + // m_stats[ODENativeCollisionFrameMsStatName] = 0; + + m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0; + m_stats[ODENativeGeomCollisionFrameMsStatName] = 0; m_stats[ODEAvatarContactsStatsName] = 0; m_stats[ODEPrimContactsStatName] = 0; } -- cgit v1.1