Add an optional mechanism for physics modules to collect and return arbitrary stats.

If active, the physics module can return arbitrary stat counters that can be seen via the MonitoringModule
(http://opensimulator.org/wiki/Monitoring_Module)
This is only active in OdeScene if collect_stats = true in [ODEPhysicsSettings].
This patch allows OdeScene to collect elapsed time information for calls to the ODE native collision methods to assess what proportion of time this takes compared to total physics processing.
This data is returned as ODENativeCollisionFrameMS in the monitoring module, updated every 3 seconds.
The performance effect of collecting stats is probably extremely minor, dwarfed by the rest of the physics code.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-05-31 01:52:26 +01:00
parent bf0b8170f7
commit 0b02a4d42e
6 changed files with 271 additions and 71 deletions

View File

@@ -192,8 +192,22 @@ namespace OpenSim.Region.Physics.Manager
public abstract void AddPhysicsActorTaint(PhysicsActor prim);
/// <summary>
/// Perform a simulation of the current physics scene over the given timestep.
/// </summary>
/// <param name="timeStep"></param>
/// <returns>The number of frames simulated over that period.</returns>
public abstract float Simulate(float timeStep);
/// <summary>
/// Get statistics about this scene.
/// </summary>
/// <remarks>This facility is currently experimental and subject to change.</remarks>
/// <returns>
/// A dictionary where the key is the statistic name. If no statistics are supplied then returns null.
/// </returns>
public virtual Dictionary<string, float> GetStats() { return null; }
public abstract void GetResults();
public abstract void SetTerrain(float[] heightMap);