* refactor: Call StatsReporter methods directly rather than through Scene (as WebStatsModule was doing)
* Assume that StatsReporter is always present (possibly as a no-op impl) rather than doing null checks0.6.5-rc1
parent
7322e19212
commit
5146cb7a72
|
@ -291,7 +291,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
|
|||
{
|
||||
sender.Sending = false;
|
||||
//m_log.DebugFormat("[TEXTURE]: Removing download stat for {0}", sender.assetID);
|
||||
m_scene.AddPendingDownloads(-1);
|
||||
m_scene.StatsReporter.AddPendingDownloads(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload
|
|||
return;
|
||||
}
|
||||
|
||||
m_scene.AddPendingDownloads(1);
|
||||
m_scene.StatsReporter.AddPendingDownloads(1);
|
||||
|
||||
TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
|
||||
m_textureSenders.Add(e.RequestedAssetID, requestHandler);
|
||||
|
|
|
@ -1974,8 +1974,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
client.OnGodKickUser += godsModule.KickUser;
|
||||
client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers;
|
||||
|
||||
if (StatsReporter != null)
|
||||
client.OnNetworkStatsUpdate += StatsReporter.AddPacketsFromClientStats;
|
||||
client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats;
|
||||
|
||||
// EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
@ -2793,29 +2792,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID);
|
||||
}
|
||||
|
||||
public void AddPacketStats(int inPackets, int outPackets, int unAckedBytes)
|
||||
{
|
||||
StatsReporter.AddInPackets(inPackets);
|
||||
StatsReporter.AddOutPackets(outPackets);
|
||||
StatsReporter.AddunAckedBytes(unAckedBytes);
|
||||
}
|
||||
|
||||
public void AddAgentTime(int ms)
|
||||
{
|
||||
StatsReporter.addFrameMS(ms);
|
||||
StatsReporter.addAgentMS(ms);
|
||||
}
|
||||
|
||||
public void AddAgentUpdates(int count)
|
||||
{
|
||||
StatsReporter.AddAgentUpdates(count);
|
||||
}
|
||||
|
||||
public void AddPendingDownloads(int count)
|
||||
{
|
||||
StatsReporter.addPendingDownload(count);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set)
|
||||
|
|
|
@ -799,7 +799,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
break;
|
||||
}
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
}
|
||||
|
||||
#region Status Methods
|
||||
|
@ -1382,7 +1382,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_scene.EventManager.TriggerOnClientMovement(this);
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
}
|
||||
|
||||
public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client)
|
||||
|
@ -2068,7 +2068,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
newVelocity.Z = direc.Z;
|
||||
m_forcesList.Add(newVelocity);
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -2140,8 +2140,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z),
|
||||
new Vector3(vel.X, vel.Y, vel.Z), rot);
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.AddAgentUpdates(1);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentUpdates(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2158,7 +2158,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
lastPhysPos = AbsolutePosition;
|
||||
lastPhysRot = m_bodyRot;
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
|
||||
}
|
||||
|
||||
|
@ -2199,7 +2199,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations);
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
}
|
||||
|
||||
public void CoarseLocationChange()
|
||||
|
@ -2231,7 +2231,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
|
||||
LocalId, m_pos, m_appearance.Texture.GetBytes(),
|
||||
m_parentID, rot);
|
||||
m_scene.AddAgentUpdates(1);
|
||||
m_scene.StatsReporter.AddAgentUpdates(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -2260,8 +2260,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
}
|
||||
m_scene.AddAgentUpdates(avatars.Count);
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
|
||||
m_scene.StatsReporter.AddAgentUpdates(avatars.Count);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
|
||||
//SendAnimPack();
|
||||
}
|
||||
|
@ -2277,8 +2278,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SendFullUpdateToOtherClient(avatar);
|
||||
|
||||
}
|
||||
m_scene.AddAgentUpdates(avatars.Count);
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentUpdates(avatars.Count);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
|
||||
SendAnimPack();
|
||||
}
|
||||
|
@ -2333,7 +2334,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
});
|
||||
|
||||
m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -407,7 +407,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// private static readonly log4net.ILog m_log
|
||||
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public void addPendingDownload(int count)
|
||||
public void AddPendingDownloads(int count)
|
||||
{
|
||||
m_pendingDownloads += count;
|
||||
if (m_pendingDownloads < 0) m_pendingDownloads = 0;
|
||||
|
@ -437,12 +437,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
return lastReportedSimFPS;
|
||||
}
|
||||
|
||||
public void AddPacketsFromClientStats(int inPackets, int outPackets, int unAckedBytes)
|
||||
public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
|
||||
{
|
||||
AddInPackets(inPackets);
|
||||
AddOutPackets(outPackets);
|
||||
AddunAckedBytes(unAckedBytes);
|
||||
}
|
||||
|
||||
public void AddAgentTime(int ms)
|
||||
{
|
||||
addFrameMS(ms);
|
||||
addAgentMS(ms);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue