From 331db2336c4934d1c6cd79eff2719ae18f8ce1af Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 12 Dec 2007 14:07:26 +0000 Subject: * Added Object count to sim stats (it's incorrect, however, it'll be fixed) --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 6 ++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 1 + .../Region/Environment/Scenes/SimStatsReporter.cs | 24 +++++++++++++++------- 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index b274d47..3fe9a7b 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -281,6 +281,12 @@ namespace OpenSim.Region.Environment.Scenes { return m_numRootAgents; } + + public int GetTotalObjects() + { + return m_numPrim; + } + #endregion #region Get Methods diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ba43c37..fb7a558 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -581,6 +581,7 @@ namespace OpenSim.Region.Environment.Scenes m_statsReporter.AddInPackets(0); m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); + m_statsReporter.SetObjects(m_innerScene.GetTotalObjects()); } catch (NotImplementedException) diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index b0f0e06..6810b16 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -20,6 +20,7 @@ namespace OpenSim.Region.Environment.Scenes SimFPS = 1, PhysicsFPS = 2, AgentUpdates = 3, + TotalPrim = 11, Agents = 13, ChildAgents = 14, InPacketsPerSecond = 17, @@ -34,6 +35,7 @@ namespace OpenSim.Region.Environment.Scenes private float m_agentUpdates = 0; private int m_rootAgents = 0; private int m_childAgents = 0; + private int m_numPrim = 0; private int m_inPacketsPerSecond = 0; private int m_outPacketsPerSecond = 0; private int m_unAckedBytes = 0; @@ -55,7 +57,7 @@ namespace OpenSim.Region.Environment.Scenes { m_report.Enabled = false; SimStatsPacket statpack = new SimStatsPacket(); - SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[9]; + SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[10]; statpack.Region = new SimStatsPacket.RegionBlock(); statpack.Region.RegionX = ReportingRegion.RegionLocX; statpack.Region.RegionY = ReportingRegion.RegionLocY; @@ -94,16 +96,20 @@ namespace OpenSim.Region.Environment.Scenes sb[5].StatValue = m_childAgents; sb[6] = new SimStatsPacket.StatBlock(); - sb[6].StatID = (uint)Stats.InPacketsPerSecond; - sb[6].StatValue = (int)(m_inPacketsPerSecond / statsUpdatesEveryMS); + sb[6].StatID = (uint)Stats.TotalPrim; + sb[6].StatValue = m_numPrim; sb[7] = new SimStatsPacket.StatBlock(); - sb[7].StatID = (uint)Stats.OutPacketsPerSecond; - sb[7].StatValue = (int)(m_outPacketsPerSecond / statsUpdatesEveryMS); + sb[7].StatID = (uint)Stats.InPacketsPerSecond; + sb[7].StatValue = (int)(m_inPacketsPerSecond / statsUpdatesEveryMS); sb[8] = new SimStatsPacket.StatBlock(); - sb[8].StatID = (uint)Stats.UnAckedBytes; - sb[8].StatValue = (int) (m_unAckedBytes / statsUpdatesEveryMS); + sb[8].StatID = (uint)Stats.OutPacketsPerSecond; + sb[8].StatValue = (int)(m_outPacketsPerSecond / statsUpdatesEveryMS); + + sb[9] = new SimStatsPacket.StatBlock(); + sb[9].StatID = (uint)Stats.UnAckedBytes; + sb[9].StatValue = (int) (m_unAckedBytes / statsUpdatesEveryMS); statpack.Stat = sb; @@ -137,6 +143,10 @@ namespace OpenSim.Region.Environment.Scenes { m_childAgents = childAgents; } + public void SetObjects(int objects) + { + m_numPrim = objects; + } public void AddFPS(int frames) { m_fps += frames; -- cgit v1.1