From 0b02a4d42e989609a4e1ba39d2aee9a7f9655613 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 31 May 2012 01:52:26 +0100
Subject: 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.
---
OpenSim/Region/Physics/Manager/PhysicsScene.cs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 2a6163c..b32cd30 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -192,8 +192,22 @@ namespace OpenSim.Region.Physics.Manager
public abstract void AddPhysicsActorTaint(PhysicsActor prim);
+ ///
+ /// Perform a simulation of the current physics scene over the given timestep.
+ ///
+ ///
+ /// The number of frames simulated over that period.
public abstract float Simulate(float timeStep);
+ ///
+ /// Get statistics about this scene.
+ ///
+ /// This facility is currently experimental and subject to change.
+ ///
+ /// A dictionary where the key is the statistic name. If no statistics are supplied then returns null.
+ ///
+ public virtual Dictionary GetStats() { return null; }
+
public abstract void GetResults();
public abstract void SetTerrain(float[] heightMap);
--
cgit v1.1