Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-06-01 06:58:26 -04:00
commit f88a26b861
3 changed files with 39 additions and 33 deletions

View File

@ -1462,10 +1462,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.AddPhysicsFPS(physicsFPS);
StatsReporter.AddTimeDilation(TimeDilation);
StatsReporter.AddFPS(1);
StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount());
StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount());
StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
// frameMS currently records work frame times, not total frame times (work + any required sleep to
// reach min frame time.
@ -1474,7 +1470,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter.addAgentMS(agentMS);
StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
StatsReporter.addOtherMS(otherMS);
StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS());
if (LoginsDisabled && Frame == 20)

View File

@ -207,6 +207,10 @@ namespace OpenSim.Region.Framework.Scenes
m_report.Close();
}
/// <summary>
/// Sets the number of milliseconds between stat updates.
/// </summary>
/// <param name='ms'></param>
public void SetUpdateMS(int ms)
{
statsUpdatesEveryMS = ms;
@ -255,6 +259,16 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
m_rootAgents = m_scene.SceneGraph.GetRootAgentCount();
m_childAgents = m_scene.SceneGraph.GetChildAgentCount();
m_numPrim = m_scene.SceneGraph.GetTotalObjectsCount();
m_activePrim = m_scene.SceneGraph.GetActiveObjectsCount();
m_activeScripts = m_scene.SceneGraph.GetActiveScriptsCount();
// FIXME: Checking for stat sanity is a complex approach. What we really need to do is fix the code
// so that stat numbers are always consistent.
CheckStatSanity();
//Our time dilation is 0.91 when we're running a full speed,
// therefore to make sure we get an appropriate range,
// we have to factor in our error. (0.10f * statsUpdateFactor)
@ -408,13 +422,6 @@ namespace OpenSim.Region.Framework.Scenes
m_timeDilation = td;
}
public void SetRootAgents(int rootAgents)
{
m_rootAgents = rootAgents;
CheckStatSanity();
}
internal void CheckStatSanity()
{
if (m_rootAgents < 0 || m_childAgents < 0)
@ -431,22 +438,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void SetChildAgents(int childAgents)
{
m_childAgents = childAgents;
CheckStatSanity();
}
public void SetObjects(int objects)
{
m_numPrim = objects;
}
public void SetActiveObjects(int objects)
{
m_activePrim = objects;
}
public void AddFPS(int frames)
{
m_fps += frames;
@ -528,11 +519,6 @@ namespace OpenSim.Region.Framework.Scenes
m_scriptLinesPerSecond += count;
}
public void SetActiveScripts(int count)
{
m_activeScripts = count;
}
public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
{
AddInPackets(inPackets);

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>
@ -1025,6 +1040,10 @@ namespace OpenSim.Region.Physics.OdePlugin
count = CollideGeoms(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf);
// All code after this is only relevant if we have any collisions
if (count <= 0)
return;
if (count > contacts.Length)
m_log.Error("[ODE SCENE]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length);
}
@ -4216,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();
}