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

*** This only works for LLCLientView at the moment ***
0.6.1-post-fixes
lbsa71 2008-12-18 13:16:41 +00:00
parent 0f25e8298b
commit 56f1b03cd0
6 changed files with 55 additions and 6 deletions

View File

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

View File

@ -675,10 +675,11 @@ namespace OpenSim
m_console.Notice("script - manually trigger scripts? or script commands?"); m_console.Notice("script - manually trigger scripts? or script commands?");
m_console.Notice("set-time [x] - set the current scene time phase"); m_console.Notice("set-time [x] - set the current scene time phase");
m_console.Notice("show assets - show state of asset cache."); m_console.Notice("show assets - show state of asset cache.");
m_console.Notice("show modules - shows info about loaded modules.");
m_console.Notice("show queues - show packet queues length for all clients.");
m_console.Notice("show regions - show running region information.");
m_console.Notice("show users - show info about connected users (only root agents)."); m_console.Notice("show users - show info about connected users (only root agents).");
m_console.Notice("show users full - show info about connected users (root and child agents)."); m_console.Notice("show users full - show info about connected users (root and child agents).");
m_console.Notice("show modules - shows info about loaded modules.");
m_console.Notice("show regions - show running region information.");
m_console.Notice("config set section field value - set a config value"); m_console.Notice("config set section field value - set a config value");
m_console.Notice("config get section field - get a config value"); m_console.Notice("config get section field - get a config value");
m_console.Notice("config save - save OpenSim.ini"); m_console.Notice("config save - save OpenSim.ini");
@ -769,9 +770,50 @@ namespace OpenSim
scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString()); scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString());
}); });
break; 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> /// <summary>
/// Create a new user /// Create a new user
/// </summary> /// </summary>

View File

@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Handles new client connections /// Handles new client connections
/// Constructor takes a single Packet and authenticates everything /// Constructor takes a single Packet and authenticates everything
/// </summary> /// </summary>
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IStatsCollector
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -8093,5 +8093,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
public string Report()
{
LLPacketHandler handler = (LLPacketHandler) m_PacketHandler;
return handler.PacketQueue.GetStats();
}
} }
} }

View File

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

View File

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