Break down native ODE collision frame time stat into native space collision and geom collision stats

0.7.4.1
Justin Clark-Casey (justincc) 2012-06-01 01:27:19 +01:00
parent c33c8db825
commit 8333b928fa
1 changed files with 22 additions and 4 deletions

View File

@ -147,6 +147,16 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
public const string ODENativeCollisionFrameMsStatName = "ODENativeCollisionFrameMS";
/// <summary>
/// Stat name for recording the number of milliseconds that ODE spends in native space collision code.
/// </summary>
public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS";
/// <summary>
/// Stat name for recording the number of milliseconds that ODE spends in native geom collision code.
/// </summary>
public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS";
/// <summary>
/// Stat name for the number of avatar collisions with another entity.
/// </summary>
@ -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;
}
@ -4080,6 +4090,10 @@ namespace OpenSim.Region.Physics.OdePlugin
{
returnStats = new Dictionary<string, float>(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;
}