* Added Active(physical) object count to the SimStatsReporter

afrisby
Teravus Ovares 2007-12-14 00:49:40 +00:00
parent f773733fcb
commit 7fdfeb5830
4 changed files with 48 additions and 8 deletions

View File

@ -60,6 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
protected int m_numRootAgents = 0;
protected int m_numPrim = 0;
protected int m_numChildAgents = 0;
protected int m_physicalPrim = 0;
internal object m_syncRoot = new object();
@ -177,7 +178,14 @@ namespace OpenSim.Region.Environment.Scenes
m_numPrim++;
}
}
public void AddPhysicalPrim(int number)
{
m_physicalPrim++;
}
public void RemovePhysicalPrim(int number)
{
m_physicalPrim--;
}
public void RemovePrim(uint localID, LLUUID avatar_deleter)
{
foreach (EntityBase obj in Entities.Values)
@ -287,6 +295,11 @@ namespace OpenSim.Region.Environment.Scenes
return m_numPrim;
}
public int GetActiveObjects()
{
return m_physicalPrim;
}
#endregion
#region Get Methods

View File

@ -582,6 +582,7 @@ namespace OpenSim.Region.Environment.Scenes
m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount());
m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount());
m_statsReporter.SetObjects(m_innerScene.GetTotalObjects());
m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects());
}
catch (NotImplementedException)
@ -1918,6 +1919,17 @@ namespace OpenSim.Region.Environment.Scenes
{
m_innerScene.SwapRootChildAgent(rootChildChildRootTF);
}
public void AddPhysicalPrim(int num)
{
m_innerScene.AddPhysicalPrim(num);
}
public void RemovePhysicalPrim(int num)
{
m_innerScene.RemovePhysicalPrim(num);
}
/// <summary>
///
/// </summary>

View File

@ -1161,6 +1161,9 @@ namespace OpenSim.Region.Environment.Scenes
if (PhysActor.IsPhysical)
{
if (!isNew)
this.ParentGroup.m_scene.RemovePhysicalPrim(1);
PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate;
PhysActor.OnOutOfBounds -= PhysicsOutOfBounds;
}
@ -1184,6 +1187,8 @@ namespace OpenSim.Region.Environment.Scenes
//RotationOffset.Y, RotationOffset.Z), UsePhysics);
if (UsePhysics)
{
this.ParentGroup.m_scene.AddPhysicalPrim(1);
PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
PhysActor.OnOutOfBounds += PhysicsOutOfBounds;
}

View File

@ -21,6 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
PhysicsFPS = 2,
AgentUpdates = 3,
TotalPrim = 11,
ActivePrim = 12,
Agents = 13,
ChildAgents = 14,
InPacketsPerSecond = 17,
@ -38,6 +39,7 @@ namespace OpenSim.Region.Environment.Scenes
private int m_numPrim = 0;
private int m_inPacketsPerSecond = 0;
private int m_outPacketsPerSecond = 0;
private int m_activePrim = 0;
private int m_unAckedBytes = 0;
private RegionInfo ReportingRegion;
@ -57,7 +59,7 @@ namespace OpenSim.Region.Environment.Scenes
{
m_report.Enabled = false;
SimStatsPacket statpack = new SimStatsPacket();
SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[10];
SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[11];
statpack.Region = new SimStatsPacket.RegionBlock();
statpack.Region.RegionX = ReportingRegion.RegionLocX;
statpack.Region.RegionY = ReportingRegion.RegionLocY;
@ -100,16 +102,20 @@ namespace OpenSim.Region.Environment.Scenes
sb[6].StatValue = m_numPrim;
sb[7] = new SimStatsPacket.StatBlock();
sb[7].StatID = (uint)Stats.InPacketsPerSecond;
sb[7].StatValue = (int)(m_inPacketsPerSecond / statsUpdatesEveryMS);
sb[7].StatID = (uint)Stats.ActivePrim;
sb[7].StatValue = m_activePrim;
sb[8] = new SimStatsPacket.StatBlock();
sb[8].StatID = (uint)Stats.OutPacketsPerSecond;
sb[8].StatValue = (int)(m_outPacketsPerSecond / statsUpdatesEveryMS);
sb[8].StatID = (uint)Stats.InPacketsPerSecond;
sb[8].StatValue = (int)(m_inPacketsPerSecond / statsUpdatesEveryMS);
sb[9] = new SimStatsPacket.StatBlock();
sb[9].StatID = (uint)Stats.UnAckedBytes;
sb[9].StatValue = (int) (m_unAckedBytes / statsUpdatesEveryMS);
sb[9].StatID = (uint)Stats.OutPacketsPerSecond;
sb[9].StatValue = (int)(m_outPacketsPerSecond / statsUpdatesEveryMS);
sb[10] = new SimStatsPacket.StatBlock();
sb[10].StatID = (uint)Stats.UnAckedBytes;
sb[10].StatValue = (int) (m_unAckedBytes / statsUpdatesEveryMS);
statpack.Stat = sb;
@ -147,6 +153,10 @@ namespace OpenSim.Region.Environment.Scenes
{
m_numPrim = objects;
}
public void SetActiveObjects(int objects)
{
m_activePrim = objects;
}
public void AddFPS(int frames)
{
m_fps += frames;