Add optional total avatars, total prims and active prims stats to ODE plugin.

These will act as a sanity check with the main scene stats, to show that physics scene entities are being managed properly.
Total prims will not match scene total prims since physics total does not include phantom prims
0.7.4.1
Justin Clark-Casey (justincc) 2012-06-01 04:23:36 +01:00
parent 4e06a46dc5
commit 6375db1533
1 changed files with 21 additions and 0 deletions

View File

@ -142,6 +142,21 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
private Dictionary<string, float> m_stats = new Dictionary<string, float>();
/// <summary>
/// Stat name for total number of avatars in this ODE scene.
/// </summary>
public const string ODETotalAvatarsStatName = "ODETotalAvatars";
/// <summary>
/// Stat name for total number of prims in this ODE scene.
/// </summary>
public const string ODETotalPrimsStatName = "ODETotalPrims";
/// <summary>
/// Stat name for total number of prims with active physics in this ODE scene.
/// </summary>
public const string ODEActivePrimsStatName = "ODEActivePrims";
/// <summary>
/// Stat name for the total time spent in ODE frame processing.
/// </summary>
@ -4220,6 +4235,12 @@ namespace OpenSim.Region.Physics.OdePlugin
{
returnStats = new Dictionary<string, float>(m_stats);
// FIXME: This is a SUPER DUMB HACK until we can establish stats that aren't subject to a division by
// 3 from the SimStatsReporter.
returnStats[ODETotalAvatarsStatName] = _characters.Count * 3;
returnStats[ODETotalPrimsStatName] = _prims.Count * 3;
returnStats[ODEActivePrimsStatName] = _activeprims.Count * 3;
InitializeExtraStats();
}