From 72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 1 Jun 2012 04:45:42 +0100 Subject: Instead of updating sim stats root agent, child, objects and scripts accounts every single scene frame, update in the once every 3 seconds SimStatsReporter run --- .../Region/Framework/Scenes/SimStatsReporter.cs | 42 ++++++++-------------- 1 file changed, 14 insertions(+), 28 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SimStatsReporter.cs') diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 08d8d7c..87af311 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -207,6 +207,10 @@ namespace OpenSim.Region.Framework.Scenes m_report.Close(); } + /// + /// Sets the number of milliseconds between stat updates. + /// + /// public void SetUpdateMS(int ms) { statsUpdatesEveryMS = ms; @@ -254,6 +258,16 @@ namespace OpenSim.Region.Framework.Scenes physfps = 0; #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, @@ -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); -- cgit v1.1