aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs57
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs39
2 files changed, 57 insertions, 39 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
index 354a47d..438331a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
30using NDesk.Options; 31using NDesk.Options;
31using OpenSim.Framework; 32using OpenSim.Framework;
32using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
@@ -174,6 +175,62 @@ namespace OpenSim.Region.ClientStack.LindenUDP
174 m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbit", m_udpServer.MaxTotalDripRate / 8 / 1000) : "unset"); 175 m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbit", m_udpServer.MaxTotalDripRate / 8 / 1000) : "unset");
175 176
176 m_console.Output(cdl.ToString()); 177 m_console.Output(cdl.ToString());
178
179 m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer));
180 }
181
182 private string GetServerThrottlesReport(LLUDPServer udpServer)
183 {
184 StringBuilder report = new StringBuilder();
185
186 report.AppendFormat(
187 "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}\n",
188 "Max",
189 "Total",
190 "Resend",
191 "Land",
192 "Wind",
193 "Cloud",
194 "Task",
195 "Texture",
196 "Asset");
197
198 report.AppendFormat(
199 "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}\n",
200 "kb/s",
201 "kb/s",
202 "kb/s",
203 "kb/s",
204 "kb/s",
205 "kb/s",
206 "kb/s",
207 "kb/s",
208 "kb/s");
209
210 report.AppendLine();
211
212 ThrottleRates throttleRates = udpServer.ThrottleRates;
213 report.AppendFormat(
214 "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}",
215 "-",
216 (throttleRates.Total * 8) / 1000,
217 (throttleRates.Resend * 8) / 1000,
218 (throttleRates.Land * 8) / 1000,
219 (throttleRates.Wind * 8) / 1000,
220 (throttleRates.Cloud * 8) / 1000,
221 (throttleRates.Task * 8) / 1000,
222 (throttleRates.Texture * 8) / 1000,
223 (throttleRates.Asset * 8) / 1000);
224
225 return report.ToString();
226 }
227
228 protected string GetColumnEntry(string entry, int maxLength, int columnPadding)
229 {
230 return string.Format(
231 "{0,-" + maxLength + "}{1,-" + columnPadding + "}",
232 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry,
233 "");
177 } 234 }
178 235
179 private void HandleDataCommand(string module, string[] args) 236 private void HandleDataCommand(string module, string[] args)
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 2ef3c4c..d471062 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -513,8 +513,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
513 513
514 report.AppendLine(); 514 report.AppendLine();
515 515
516 bool firstClient = true;
517
518 lock (m_scenes) 516 lock (m_scenes)
519 { 517 {
520 foreach (Scene scene in m_scenes.Values) 518 foreach (Scene scene in m_scenes.Values)
@@ -526,12 +524,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
526 { 524 {
527 LLClientView llClient = client as LLClientView; 525 LLClientView llClient = client as LLClientView;
528 526
529 if (firstClient)
530 {
531 report.AppendLine(GetServerThrottlesReport(llClient.UDPServer));
532 firstClient = false;
533 }
534
535 bool isChild = client.SceneAgent.IsChildAgent; 527 bool isChild = client.SceneAgent.IsChildAgent;
536 if (isChild && !showChildren) 528 if (isChild && !showChildren)
537 return; 529 return;
@@ -569,37 +561,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
569 561
570 return report.ToString(); 562 return report.ToString();
571 } 563 }
572
573 protected string GetServerThrottlesReport(LLUDPServer udpServer)
574 {
575 StringBuilder report = new StringBuilder();
576
577 int columnPadding = 2;
578 int maxNameLength = 18;
579 int maxRegionNameLength = 14;
580 int maxTypeLength = 4;
581
582 string name = "SERVER AGENT RATES";
583
584 report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
585 report.Append(GetColumnEntry("-", maxRegionNameLength, columnPadding));
586 report.Append(GetColumnEntry("-", maxTypeLength, columnPadding));
587
588 ThrottleRates throttleRates = udpServer.ThrottleRates;
589 report.AppendFormat(
590 "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}",
591 "-",
592 (throttleRates.Total * 8) / 1000,
593 (throttleRates.Resend * 8) / 1000,
594 (throttleRates.Land * 8) / 1000,
595 (throttleRates.Wind * 8) / 1000,
596 (throttleRates.Cloud * 8) / 1000,
597 (throttleRates.Task * 8) / 1000,
598 (throttleRates.Texture * 8) / 1000,
599 (throttleRates.Asset * 8) / 1000);
600
601 return report.ToString();
602 }
603 564
604 /// <summary> 565 /// <summary>
605 /// Show client stats data 566 /// Show client stats data