aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs121
1 files changed, 110 insertions, 11 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 6a24cc1..db17d8f 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -82,6 +82,14 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
82 m_scenes[scene.RegionInfo.RegionID] = scene; 82 m_scenes[scene.RegionInfo.RegionID] = scene;
83 83
84 scene.AddCommand( 84 scene.AddCommand(
85 this, "show pqueues",
86 "show pqueues [full]",
87 "Show priority queue data for each client",
88 "Without the 'full' option, only root agents are shown."
89 + " With the 'full' option child agents are also shown.",
90 ShowPQueuesReport);
91
92 scene.AddCommand(
85 this, "show queues", 93 this, "show queues",
86 "show queues [full]", 94 "show queues [full]",
87 "Show queue data for each client", 95 "Show queue data for each client",
@@ -119,6 +127,11 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
119// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 127// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
120 } 128 }
121 129
130 protected void ShowPQueuesReport(string module, string[] cmd)
131 {
132 MainConsole.Instance.Output(GetPQueuesReport(cmd));
133 }
134
122 protected void ShowQueuesReport(string module, string[] cmd) 135 protected void ShowQueuesReport(string module, string[] cmd)
123 { 136 {
124 MainConsole.Instance.Output(GetQueuesReport(cmd)); 137 MainConsole.Instance.Output(GetQueuesReport(cmd));
@@ -155,6 +168,80 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
155 ""); 168 "");
156 } 169 }
157 170
171
172 /// <summary>
173 /// Generate UDP Queue data report for each client
174 /// </summary>
175 /// <param name="showParams"></param>
176 /// <returns></returns>
177 protected string GetPQueuesReport(string[] showParams)
178 {
179 bool showChildren = false;
180 string pname = "";
181
182 if (showParams.Length > 2 && showParams[2] == "full")
183 showChildren = true;
184 else if (showParams.Length > 3)
185 pname = showParams[2] + " " + showParams[3];
186
187 StringBuilder report = new StringBuilder();
188
189 int columnPadding = 2;
190 int maxNameLength = 18;
191 int maxRegionNameLength = 14;
192 int maxTypeLength = 4;
193 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
194
195 report.Append(GetColumnEntry("User", maxNameLength, columnPadding));
196 report.Append(GetColumnEntry("Region", maxRegionNameLength, columnPadding));
197 report.Append(GetColumnEntry("Type", maxTypeLength, columnPadding));
198
199 report.AppendFormat(
200 "{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7} {10,7} {11,7}\n",
201 "Pri 0",
202 "Pri 1",
203 "Pri 2",
204 "Pri 3",
205 "Pri 4",
206 "Pri 5",
207 "Pri 6",
208 "Pri 7",
209 "Pri 8",
210 "Pri 9",
211 "Pri 10",
212 "Pri 11");
213
214 lock (m_scenes)
215 {
216 foreach (Scene scene in m_scenes.Values)
217 {
218 scene.ForEachClient(
219 delegate(IClientAPI client)
220 {
221 if (client is LLClientView)
222 {
223 bool isChild = scene.PresenceChildStatus(client.AgentId);
224 if (isChild && !showChildren)
225 return;
226
227 string name = client.Name;
228 if (pname != "" && name != pname)
229 return;
230
231 string regionName = scene.RegionInfo.RegionName;
232
233 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
234 report.Append(GetColumnEntry(regionName, maxRegionNameLength, columnPadding));
235 report.Append(GetColumnEntry(isChild ? "Cd" : "Rt", maxTypeLength, columnPadding));
236 report.AppendLine(((LLClientView)client).EntityUpdateQueue.ToString());
237 }
238 });
239 }
240 }
241
242 return report.ToString();
243 }
244
158 /// <summary> 245 /// <summary>
159 /// Generate UDP Queue data report for each client 246 /// Generate UDP Queue data report for each client
160 /// </summary> 247 /// </summary>
@@ -163,10 +250,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
163 protected string GetQueuesReport(string[] showParams) 250 protected string GetQueuesReport(string[] showParams)
164 { 251 {
165 bool showChildren = false; 252 bool showChildren = false;
253 string pname = "";
166 254
167 if (showParams.Length > 2 && showParams[2] == "full") 255 if (showParams.Length > 2 && showParams[2] == "full")
168 showChildren = true; 256 showChildren = true;
169 257 else if (showParams.Length > 3)
258 pname = showParams[2] + " " + showParams[3];
259
170 StringBuilder report = new StringBuilder(); 260 StringBuilder report = new StringBuilder();
171 261
172 int columnPadding = 2; 262 int columnPadding = 2;
@@ -224,6 +314,9 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
224 return; 314 return;
225 315
226 string name = client.Name; 316 string name = client.Name;
317 if (pname != "" && name != pname)
318 return;
319
227 string regionName = scene.RegionInfo.RegionName; 320 string regionName = scene.RegionInfo.RegionName;
228 321
229 report.Append(GetColumnEntry(name, maxNameLength, columnPadding)); 322 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
@@ -249,10 +342,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
249 protected string GetThrottlesReport(string[] showParams) 342 protected string GetThrottlesReport(string[] showParams)
250 { 343 {
251 bool showChildren = false; 344 bool showChildren = false;
345 string pname = "";
252 346
253 if (showParams.Length > 2 && showParams[2] == "full") 347 if (showParams.Length > 2 && showParams[2] == "full")
254 showChildren = true; 348 showChildren = true;
255 349 else if (showParams.Length > 3)
350 pname = showParams[2] + " " + showParams[3];
351
256 StringBuilder report = new StringBuilder(); 352 StringBuilder report = new StringBuilder();
257 353
258 int columnPadding = 2; 354 int columnPadding = 2;
@@ -302,7 +398,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
302 if (client is LLClientView) 398 if (client is LLClientView)
303 { 399 {
304 LLClientView llClient = client as LLClientView; 400 LLClientView llClient = client as LLClientView;
305 401
306 if (firstClient) 402 if (firstClient)
307 { 403 {
308 report.AppendLine(GetServerThrottlesReport(llClient.UDPServer)); 404 report.AppendLine(GetServerThrottlesReport(llClient.UDPServer));
@@ -314,6 +410,9 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
314 return; 410 return;
315 411
316 string name = client.Name; 412 string name = client.Name;
413 if (pname != "" && name != pname)
414 return;
415
317 string regionName = scene.RegionInfo.RegionName; 416 string regionName = scene.RegionInfo.RegionName;
318 417
319 LLUDPClient llUdpClient = llClient.UDPClient; 418 LLUDPClient llUdpClient = llClient.UDPClient;
@@ -352,7 +451,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
352 int maxRegionNameLength = 14; 451 int maxRegionNameLength = 14;
353 int maxTypeLength = 4; 452 int maxTypeLength = 4;
354 453
355 string name = "SERVER AGENT LIMITS"; 454 string name = "SERVER AGENT RATES";
356 455
357 report.Append(GetColumnEntry(name, maxNameLength, columnPadding)); 456 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
358 report.Append(GetColumnEntry("-", maxRegionNameLength, columnPadding)); 457 report.Append(GetColumnEntry("-", maxRegionNameLength, columnPadding));
@@ -362,13 +461,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
362 report.AppendFormat( 461 report.AppendFormat(
363 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}", 462 "{0,7} {1,8} {2,7} {3,7} {4,7} {5,7} {6,9} {7,7}",
364 (throttleRates.Total * 8) / 1000, 463 (throttleRates.Total * 8) / 1000,
365 (throttleRates.ResendLimit * 8) / 1000, 464 (throttleRates.Resend * 8) / 1000,
366 (throttleRates.LandLimit * 8) / 1000, 465 (throttleRates.Land * 8) / 1000,
367 (throttleRates.WindLimit * 8) / 1000, 466 (throttleRates.Wind * 8) / 1000,
368 (throttleRates.CloudLimit * 8) / 1000, 467 (throttleRates.Cloud * 8) / 1000,
369 (throttleRates.TaskLimit * 8) / 1000, 468 (throttleRates.Task * 8) / 1000,
370 (throttleRates.TextureLimit * 8) / 1000, 469 (throttleRates.Texture * 8) / 1000,
371 (throttleRates.AssetLimit * 8) / 1000); 470 (throttleRates.Asset * 8) / 1000);
372 471
373 return report.ToString(); 472 return report.ToString();
374 } 473 }