From 56f1b03cd0eccb8549b3f87f76b2a9494239b585 Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 18 Dec 2008 13:16:41 +0000
Subject: * Added "show queues" command that shows throttling queues for all
clients. *** This only works for LLCLientView at the moment ***
---
OpenSim/Region/Application/OpenSim.cs | 46 +++++++++++++++++++++-
.../Region/ClientStack/LindenUDP/LLClientView.cs | 8 +++-
.../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 2 +-
OpenSim/Region/Environment/Scenes/Scene.cs | 2 +-
4 files changed, 53 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6cb0586..96e2d39 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -675,10 +675,11 @@ namespace OpenSim
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("show assets - show state of asset cache.");
- 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 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 full - show info about connected users (root and child agents).");
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 save - save OpenSim.ini");
@@ -769,9 +770,50 @@ 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;
+ }
+
///
/// Create a new user
///
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9d6e3af..5ce5235 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Handles new client connections
/// Constructor takes a single Packet and authenticates everything
///
- 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);
@@ -8093,5 +8093,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
}
+
+ public string Report()
+ {
+ LLPacketHandler handler = (LLPacketHandler) m_PacketHandler;
+ return handler.PacketQueue.GetStats();
+ }
}
}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 4383493..365c35f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -610,7 +610,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// See IPullStatsProvider
public string GetStats()
{
- return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
+ return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
SendQueue.Count(),
IncomingPacketQueue.Count,
OutgoingPacketQueue.Count,
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 8dcd071..7a4c385 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -4227,7 +4227,7 @@ namespace OpenSim.Region.Environment.Scenes
return m_sceneGraph.TryGetAvatarByName(avatarName, out avatar);
}
- internal void ForEachClient(Action action)
+ public void ForEachClient(Action action)
{
m_sceneGraph.ForEachClient(action);
}
--
cgit v1.1