* Added "show queues" command that shows throttling queues for all clients.

*** This only works for LLCLientView at the moment ***
0.6.0-stable
lbsa71 2008-12-18 13:02:26 +00:00
parent 9eced15408
commit 8acb60df0d
6 changed files with 197 additions and 148 deletions

View File

@ -373,7 +373,7 @@ namespace OpenSim.Framework.Servers
/// That is something that cannot be determined within this class. So
/// all attempts to use the console MUST be verified.
/// </summary>
private void Notice(string msg)
protected void Notice(string msg)
{
if (m_console != null)
{

View File

@ -63,7 +63,8 @@ namespace OpenSim
/// </summary>
private static List<ConsolePluginCommand> m_PluginCommandInfos = new List<ConsolePluginCommand>();
public OpenSim(IConfigSource configSource) : base(configSource)
public OpenSim(IConfigSource configSource)
: base(configSource)
{
}
@ -728,9 +729,49 @@ namespace OpenSim
scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString());
});
break;
case "queues":
Notice(GetQueuesReport());
break;
}
}
private string GetQueuesReport()
{
string report = String.Empty;
m_sceneManager.ForEachScene(delegate(Scene scene)
{
scene.ForEachClient(delegate(IClientAPI client)
{
if (client is IStatsCollector)
{
report = report + client.FirstName +
" " + client.LastName + "\n";
IStatsCollector stats =
(IStatsCollector)client;
report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n",
"Send",
"In",
"Out",
"Resend",
"Land",
"Wind",
"Cloud",
"Task",
"Texture",
"Asset");
report = report + stats.Report() +
"\n\n";
}
});
});
return report;
}
/// <summary>
/// Create a new user
/// </summary>

View File

@ -51,7 +51,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Handles new client connections
/// Constructor takes a single Packet and authenticates everything
/// </summary>
public class LLClientView : IClientAPI
public class LLClientView : IClientAPI, IStatsCollector
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -7265,7 +7265,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion
public void SendRegionHandle(UUID regionID, ulong handle) {
public void SendRegionHandle(UUID regionID, ulong handle)
{
RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
reply.ReplyBlock.RegionID = regionID;
reply.ReplyBlock.RegionHandle = handle;
@ -7676,5 +7677,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
KillPacket kp = new KillPacket();
OutPacket(kp, ThrottleOutPacketType.Task | ThrottleOutPacketType.LowPriority);
}
public string Report()
{
LLPacketHandler handler = (LLPacketHandler)m_PacketHandler;
return handler.PacketQueue.GetStats();
}
}
}

View File

@ -4047,7 +4047,7 @@ namespace OpenSim.Region.Environment.Scenes
return m_innerScene.TryGetAvatarByName(avatarName, out avatar);
}
internal void ForEachClient(Action<IClientAPI> action)
public void ForEachClient(Action<IClientAPI> action)
{
m_innerScene.ForEachClient(action);
}

View File

@ -2589,6 +2589,7 @@
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.Environment"/>
<Reference name="OpenSim.Region.ClientStack"/>