aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
diff options
context:
space:
mode:
authorMelanie2012-01-10 21:28:59 +0000
committerMelanie2012-01-10 21:28:59 +0000
commit8fa1108b72f053b17964d668458ab8b6c1d44f4f (patch)
tree670fe65a58d9edddb847775583ac1fd69d8dc7c0 /OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
parentMerge branch 'master' into careminster (diff)
parentrename "show image queue" to "show image queues" in line with other udp info ... (diff)
downloadopensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.zip
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.gz
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.bz2
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs104
1 files changed, 85 insertions, 19 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index c754019..58b9b9f 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
87 "Show priority queue data for each client", 87 "Show priority queue data for each client",
88 "Without the 'full' option, only root agents are shown." 88 "Without the 'full' option, only root agents are shown."
89 + " With the 'full' option child agents are also shown.", 89 + " With the 'full' option child agents are also shown.",
90 ShowPQueuesReport); 90 (mod, cmd) => MainConsole.Instance.Output(GetPQueuesReport(cmd)));
91 91
92 scene.AddCommand( 92 scene.AddCommand(
93 this, "show queues", 93 this, "show queues",
@@ -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 (mod, cmd) => MainConsole.Instance.Output(GetQueuesReport(cmd)));
99
100 scene.AddCommand(
101 this, "show image queues",
102 "show image queues <first-name> <last-name>",
103 "Show the image queues (textures downloaded via UDP) for a particular client.",
104 (mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd)));
99 105
100 scene.AddCommand( 106 scene.AddCommand(
101 this, "show throttles", 107 this, "show throttles",
@@ -103,7 +109,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
103 "Show throttle settings for each client and for the server overall", 109 "Show throttle settings for each client and for the server overall",
104 "Without the 'full' option, only root agents are shown." 110 "Without the 'full' option, only root agents are shown."
105 + " With the 'full' option child agents are also shown.", 111 + " With the 'full' option child agents are also shown.",
106 ShowThrottlesReport); 112 (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd)));
107 113
108 scene.AddCommand( 114 scene.AddCommand(
109 this, "emergency-monitoring", 115 this, "emergency-monitoring",
@@ -124,21 +130,6 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
124 public void RegionLoaded(Scene scene) 130 public void RegionLoaded(Scene scene)
125 { 131 {
126// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 132// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
127 }
128
129 protected void ShowPQueuesReport(string module, string[] cmd)
130 {
131 MainConsole.Instance.Output(GetPQueuesReport(cmd));
132 }
133
134 protected void ShowQueuesReport(string module, string[] cmd)
135 {
136 MainConsole.Instance.Output(GetQueuesReport(cmd));
137 }
138
139 protected void ShowThrottlesReport(string module, string[] cmd)
140 {
141 MainConsole.Instance.Output(GetThrottlesReport(cmd));
142 } 133 }
143 134
144 protected void EmergencyMonitoring(string module, string[] cmd) 135 protected void EmergencyMonitoring(string module, string[] cmd)
@@ -166,7 +157,6 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
166 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry, 157 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry,
167 ""); 158 "");
168 } 159 }
169
170 160
171 /// <summary> 161 /// <summary>
172 /// Generate UDP Queue data report for each client 162 /// Generate UDP Queue data report for each client
@@ -240,6 +230,82 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
240 230
241 return report.ToString(); 231 return report.ToString();
242 } 232 }
233
234 /// <summary>
235 /// Generate an image queue report
236 /// </summary>
237 /// <param name="showParams"></param>
238 /// <returns></returns>
239 private string GetImageQueuesReport(string[] showParams)
240 {
241 if (showParams.Length < 5 || showParams.Length > 6)
242 {
243 MainConsole.Instance.OutputFormat("Usage: show image queues <first-name> <last-name> [full]");
244 return "";
245 }
246
247 string firstName = showParams[3];
248 string lastName = showParams[4];
249
250 bool showChildAgents = showParams.Length == 6;
251
252 List<ScenePresence> foundAgents = new List<ScenePresence>();
253
254 lock (m_scenes)
255 {
256 foreach (Scene scene in m_scenes.Values)
257 {
258 ScenePresence sp = scene.GetScenePresence(firstName, lastName);
259 if (sp != null && (showChildAgents || !sp.IsChildAgent))
260 foundAgents.Add(sp);
261 }
262 }
263
264 if (foundAgents.Count == 0)
265 {
266 MainConsole.Instance.OutputFormat("No agents found for {0} {1}", firstName, lastName);
267 return "";
268 }
269
270 StringBuilder report = new StringBuilder();
271
272 foreach (ScenePresence agent in foundAgents)
273 {
274 LLClientView client = agent.ControllingClient as LLClientView;
275
276 if (client == null)
277 {
278 MainConsole.Instance.OutputFormat("This command is only supported for LLClientView");
279 return "";
280 }
281
282 J2KImage[] images = client.ImageManager.GetImages();
283
284 report.AppendFormat(
285 "In region {0} ({1} agent)\n",
286 agent.Scene.RegionInfo.RegionName, agent.IsChildAgent ? "child" : "root");
287 report.AppendFormat("Images in queue: {0}\n", images.Length);
288
289 if (images.Length > 0)
290 {
291 report.AppendFormat(
292 "{0,-36} {1,-8} {2,-9} {3,-9} {4,-9} {5,-7}\n",
293 "Texture ID",
294 "Last Seq",
295 "Priority",
296 "Start Pkt",
297 "Has Asset",
298 "Decoded");
299
300 foreach (J2KImage image in images)
301 report.AppendFormat(
302 "{0,36} {1,8} {2,9} {3,10} {4,9} {5,7}\n",
303 image.TextureID, image.LastSequence, image.Priority, image.StartPacket, image.HasAsset, image.IsDecoded);
304 }
305 }
306
307 return report.ToString();
308 }
243 309
244 /// <summary> 310 /// <summary>
245 /// Generate UDP Queue data report for each client 311 /// Generate UDP Queue data report for each client