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/Region/OptionalModules | |
parent | Remove DEBUG option (diff) | |
download | opensim-SC-ef074deb52de617743ad50ea29e286dd9c66722d.zip opensim-SC-ef074deb52de617743ad50ea29e286dd9c66722d.tar.gz opensim-SC-ef074deb52de617743ad50ea29e286dd9c66722d.tar.bz2 opensim-SC-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 '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 89 |
1 files changed, 88 insertions, 1 deletions
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 |