diff options
author | Justin Clark-Casey (justincc) | 2012-01-10 21:30:12 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-01-10 21:30:12 +0000 |
commit | ef074deb52de617743ad50ea29e286dd9c66722d (patch) | |
tree | 5d06a9aee6d773764dfd812df1447174dd81b434 /OpenSim | |
parent | Remove DEBUG option (diff) | |
download | opensim-SC_OLD-ef074deb52de617743ad50ea29e286dd9c66722d.zip opensim-SC_OLD-ef074deb52de617743ad50ea29e286dd9c66722d.tar.gz opensim-SC_OLD-ef074deb52de617743ad50ea29e286dd9c66722d.tar.bz2 opensim-SC_OLD-ef074deb52de617743ad50ea29e286dd9c66722d.tar.xz |
Add "show image queue <first-name> <last-name>" region console command
This is so that we can inspect the image download queue (texture download via udp) for debugging purposes.
Diffstat (limited to 'OpenSim')
3 files changed, 107 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index eb1a50e..1e72aa2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -304,6 +304,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
304 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 304 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
305 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients | 305 | protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients |
306 | 306 | ||
307 | /// <summary> | ||
308 | /// Handles UDP texture download. | ||
309 | /// </summary> | ||
310 | public LLImageManager ImageManager { get; private set; } | ||
311 | |||
307 | private readonly LLUDPServer m_udpServer; | 312 | private readonly LLUDPServer m_udpServer; |
308 | private readonly LLUDPClient m_udpClient; | 313 | private readonly LLUDPClient m_udpClient; |
309 | private readonly UUID m_sessionId; | 314 | private readonly UUID m_sessionId; |
@@ -348,7 +353,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
348 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); | 353 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); |
349 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers | 354 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers |
350 | protected Scene m_scene; | 355 | protected Scene m_scene; |
351 | private LLImageManager m_imageManager; | ||
352 | protected string m_firstName; | 356 | protected string m_firstName; |
353 | protected string m_lastName; | 357 | protected string m_lastName; |
354 | protected Thread m_clientThread; | 358 | protected Thread m_clientThread; |
@@ -459,7 +463,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
459 | 463 | ||
460 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 464 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
461 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 465 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
462 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 466 | ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
463 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 467 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
464 | m_agentId = agentId; | 468 | m_agentId = agentId; |
465 | m_sessionId = sessionId; | 469 | m_sessionId = sessionId; |
@@ -499,7 +503,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
499 | IsActive = false; | 503 | IsActive = false; |
500 | 504 | ||
501 | // Shutdown the image manager | 505 | // Shutdown the image manager |
502 | m_imageManager.Close(); | 506 | ImageManager.Close(); |
503 | 507 | ||
504 | // Fire the callback for this connection closing | 508 | // Fire the callback for this connection closing |
505 | if (OnConnectionClosed != null) | 509 | if (OnConnectionClosed != null) |
@@ -3939,7 +3943,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3939 | } | 3943 | } |
3940 | 3944 | ||
3941 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) | 3945 | if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) |
3942 | m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); | 3946 | ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); |
3943 | } | 3947 | } |
3944 | 3948 | ||
3945 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) | 3949 | public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) |
@@ -7470,7 +7474,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7470 | if ((ImageType)block.Type == ImageType.Baked) | 7474 | if ((ImageType)block.Type == ImageType.Baked) |
7471 | args.Priority *= 2.0f; | 7475 | args.Priority *= 2.0f; |
7472 | 7476 | ||
7473 | m_imageManager.EnqueueReq(args); | 7477 | ImageManager.EnqueueReq(args); |
7474 | } | 7478 | } |
7475 | 7479 | ||
7476 | return true; | 7480 | return true; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs index 3e31b7d..db428f1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs | |||
@@ -245,6 +245,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
245 | m_shuttingdown = true; | 245 | m_shuttingdown = true; |
246 | } | 246 | } |
247 | 247 | ||
248 | /// <summary> | ||
249 | /// Returns an array containing all the images in the queue. | ||
250 | /// </summary> | ||
251 | /// <returns></returns> | ||
252 | public J2KImage[] GetImages() | ||
253 | { | ||
254 | lock (m_priorityQueue) | ||
255 | return m_priorityQueue.ToArray(); | ||
256 | } | ||
257 | |||
248 | #region Priority Queue Helpers | 258 | #region Priority Queue Helpers |
249 | 259 | ||
250 | private J2KImage GetHighestPriorityImage() | 260 | private J2KImage GetHighestPriorityImage() |
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index c754019..16f6821 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | |||
@@ -95,7 +95,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden | |||
95 | "Show queue data for each client", | 95 | "Show queue data for each client", |
96 | "Without the 'full' option, only root agents are shown." | 96 | "Without the 'full' option, only root agents are shown." |
97 | + " With the 'full' option child agents are also shown.", | 97 | + " With the 'full' option child agents are also shown.", |
98 | ShowQueuesReport); | 98 | ShowQueuesReport); |
99 | |||
100 | scene.AddCommand( | ||
101 | this, "show image queue", | ||
102 | "show image queue <first-name> <last-name>", | ||
103 | "Show the image queue (textures downloaded via UDP) for a particular client.", | ||
104 | ShowImageQueuesReport); | ||
99 | 105 | ||
100 | scene.AddCommand( | 106 | scene.AddCommand( |
101 | this, "show throttles", | 107 | this, "show throttles", |
@@ -135,6 +141,11 @@ namespace OpenSim.Region.CoreModules.UDP.Linden | |||
135 | { | 141 | { |
136 | MainConsole.Instance.Output(GetQueuesReport(cmd)); | 142 | MainConsole.Instance.Output(GetQueuesReport(cmd)); |
137 | } | 143 | } |
144 | |||
145 | protected void ShowImageQueuesReport(string module, string[] cmd) | ||
146 | { | ||
147 | MainConsole.Instance.Output(GetImageQueuesReport(cmd)); | ||
148 | } | ||
138 | 149 | ||
139 | protected void ShowThrottlesReport(string module, string[] cmd) | 150 | protected void ShowThrottlesReport(string module, string[] cmd) |
140 | { | 151 | { |
@@ -240,6 +251,82 @@ namespace OpenSim.Region.CoreModules.UDP.Linden | |||
240 | 251 | ||
241 | return report.ToString(); | 252 | return report.ToString(); |
242 | } | 253 | } |
254 | |||
255 | /// <summary> | ||
256 | /// Generate an image queue report | ||
257 | /// </summary> | ||
258 | /// <param name="showParams"></param> | ||
259 | /// <returns></returns> | ||
260 | private string GetImageQueuesReport(string[] showParams) | ||
261 | { | ||
262 | if (showParams.Length < 5 || showParams.Length > 6) | ||
263 | { | ||
264 | MainConsole.Instance.OutputFormat("Usage: show image queue <first-name> <last-name> [full]"); | ||
265 | return ""; | ||
266 | } | ||
267 | |||
268 | string firstName = showParams[3]; | ||
269 | string lastName = showParams[4]; | ||
270 | |||
271 | bool showChildAgents = showParams.Length == 6; | ||
272 | |||
273 | List<ScenePresence> foundAgents = new List<ScenePresence>(); | ||
274 | |||
275 | lock (m_scenes) | ||
276 | { | ||
277 | foreach (Scene scene in m_scenes.Values) | ||
278 | { | ||
279 | ScenePresence sp = scene.GetScenePresence(firstName, lastName); | ||
280 | if (sp != null && (showChildAgents || !sp.IsChildAgent)) | ||
281 | foundAgents.Add(sp); | ||
282 | } | ||
283 | } | ||
284 | |||
285 | if (foundAgents.Count == 0) | ||
286 | { | ||
287 | MainConsole.Instance.OutputFormat("No agents found for {0} {1}", firstName, lastName); | ||
288 | return ""; | ||
289 | } | ||
290 | |||
291 | StringBuilder report = new StringBuilder(); | ||
292 | |||
293 | foreach (ScenePresence agent in foundAgents) | ||
294 | { | ||
295 | LLClientView client = agent.ControllingClient as LLClientView; | ||
296 | |||
297 | if (client == null) | ||
298 | { | ||
299 | MainConsole.Instance.OutputFormat("This command is only supported for LLClientView"); | ||
300 | return ""; | ||
301 | } | ||
302 | |||
303 | J2KImage[] images = client.ImageManager.GetImages(); | ||
304 | |||
305 | report.AppendFormat( | ||
306 | "In region {0} ({1} agent)\n", | ||
307 | agent.Scene.RegionInfo.RegionName, agent.IsChildAgent ? "child" : "root"); | ||
308 | report.AppendFormat("Images in queue: {0}\n", images.Length); | ||
309 | |||
310 | if (images.Length > 0) | ||
311 | { | ||
312 | report.AppendFormat( | ||
313 | "{0,-36} {1,-8} {2,-9} {3,-9} {4,-9} {5,-7}\n", | ||
314 | "Texture ID", | ||
315 | "Last Seq", | ||
316 | "Priority", | ||
317 | "Start Pkt", | ||
318 | "Has Asset", | ||
319 | "Decoded"); | ||
320 | |||
321 | foreach (J2KImage image in images) | ||
322 | report.AppendFormat( | ||
323 | "{0,36} {1,8} {2,9} {3,10} {4,9} {5,7}\n", | ||
324 | image.TextureID, image.LastSequence, image.Priority, image.StartPacket, image.HasAsset, image.IsDecoded); | ||
325 | } | ||
326 | } | ||
327 | |||
328 | return report.ToString(); | ||
329 | } | ||
243 | 330 | ||
244 | /// <summary> | 331 | /// <summary> |
245 | /// Generate UDP Queue data report for each client | 332 | /// Generate UDP Queue data report for each client |