aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-01 01:27:19 +0100
committerJustin Clark-Casey (justincc)2012-06-01 01:27:19 +0100
commit8333b928fa3353304358ed55293b52478a39ab6e (patch)
tree8da9cec8a40679b4694ef5c3155158601b91d52c /OpenSim/Region/Physics
parentRename new collision stats to 'contacts' - there are/can be multiple contacts... (diff)
downloadopensim-SC-8333b928fa3353304358ed55293b52478a39ab6e.zip
opensim-SC-8333b928fa3353304358ed55293b52478a39ab6e.tar.gz
opensim-SC-8333b928fa3353304358ed55293b52478a39ab6e.tar.bz2
opensim-SC-8333b928fa3353304358ed55293b52478a39ab6e.tar.xz
Break down native ODE collision frame time stat into native space collision and geom collision stats
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs26
1 files changed, 22 insertions, 4 deletions
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
148 public const string ODENativeCollisionFrameMsStatName = "ODENativeCollisionFrameMS"; 148 public const string ODENativeCollisionFrameMsStatName = "ODENativeCollisionFrameMS";
149 149
150 /// <summary> 150 /// <summary>
151 /// Stat name for recording the number of milliseconds that ODE spends in native space collision code.
152 /// </summary>
153 public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS";
154
155 /// <summary>
156 /// Stat name for recording the number of milliseconds that ODE spends in native geom collision code.
157 /// </summary>
158 public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS";
159
160 /// <summary>
151 /// Stat name for the number of avatar collisions with another entity. 161 /// Stat name for the number of avatar collisions with another entity.
152 /// </summary> 162 /// </summary>
153 public const string ODEAvatarContactsStatsName = "ODEAvatarContacts"; 163 public const string ODEAvatarContactsStatsName = "ODEAvatarContacts";
@@ -843,7 +853,7 @@ namespace OpenSim.Region.Physics.OdePlugin
843 // We do this outside the lock so that any waiting threads aren't held up, though the effect is probably 853 // We do this outside the lock so that any waiting threads aren't held up, though the effect is probably
844 // negligable 854 // negligable
845 if (CollectStats) 855 if (CollectStats)
846 m_stats[ODENativeCollisionFrameMsStatName] 856 m_stats[ODENativeGeomCollisionFrameMsStatName]
847 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); 857 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder);
848 858
849 return count; 859 return count;
@@ -867,7 +877,7 @@ namespace OpenSim.Region.Physics.OdePlugin
867 877
868 if (CollectStats && m_inCollisionTiming) 878 if (CollectStats && m_inCollisionTiming)
869 { 879 {
870 m_stats[ODENativeCollisionFrameMsStatName] 880 m_stats[ODENativeSpaceCollisionFrameMsStatName]
871 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); 881 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder);
872 m_inCollisionTiming = false; 882 m_inCollisionTiming = false;
873 } 883 }
@@ -883,7 +893,7 @@ namespace OpenSim.Region.Physics.OdePlugin
883 { 893 {
884 if (CollectStats && m_inCollisionTiming) 894 if (CollectStats && m_inCollisionTiming)
885 { 895 {
886 m_stats[ODENativeCollisionFrameMsStatName] 896 m_stats[ODENativeSpaceCollisionFrameMsStatName]
887 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder); 897 += Util.EnvironmentTickCountSubtract(m_nativeCollisionTickRecorder);
888 m_inCollisionTiming = false; 898 m_inCollisionTiming = false;
889 } 899 }
@@ -4079,6 +4089,10 @@ namespace OpenSim.Region.Physics.OdePlugin
4079 lock (OdeLock) 4089 lock (OdeLock)
4080 { 4090 {
4081 returnStats = new Dictionary<string, float>(m_stats); 4091 returnStats = new Dictionary<string, float>(m_stats);
4092
4093 returnStats[ODENativeCollisionFrameMsStatName]
4094 = returnStats[ODENativeSpaceCollisionFrameMsStatName]
4095 + returnStats[ODENativeGeomCollisionFrameMsStatName];
4082 4096
4083 InitializeExtraStats(); 4097 InitializeExtraStats();
4084 } 4098 }
@@ -4088,7 +4102,11 @@ namespace OpenSim.Region.Physics.OdePlugin
4088 4102
4089 private void InitializeExtraStats() 4103 private void InitializeExtraStats()
4090 { 4104 {
4091 m_stats[ODENativeCollisionFrameMsStatName] = 0; 4105 // No need to zero since this is calculated by addition
4106 // m_stats[ODENativeCollisionFrameMsStatName] = 0;
4107
4108 m_stats[ODENativeSpaceCollisionFrameMsStatName] = 0;
4109 m_stats[ODENativeGeomCollisionFrameMsStatName] = 0;
4092 m_stats[ODEAvatarContactsStatsName] = 0; 4110 m_stats[ODEAvatarContactsStatsName] = 0;
4093 m_stats[ODEPrimContactsStatName] = 0; 4111 m_stats[ODEPrimContactsStatName] = 0;
4094 } 4112 }