aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs138
1 files changed, 95 insertions, 43 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 5969be0..58ece34 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -30,6 +30,7 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Reflection; 32using System.Reflection;
33using System.Text;
33using System.Timers; 34using System.Timers;
34using log4net; 35using log4net;
35using Nini.Config; 36using Nini.Config;
@@ -285,16 +286,15 @@ namespace OpenSim
285 286
286 m_console.Commands.AddCommand("region", false, "show users", 287 m_console.Commands.AddCommand("region", false, "show users",
287 "show users [full]", 288 "show users [full]",
288 "Show user data", HandleShow); 289 "Show user data for users currently on the region",
290 "Without the 'full' option, only users actually on the region are shown."
291 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
292 HandleShow);
289 293
290 m_console.Commands.AddCommand("region", false, "show connections", 294 m_console.Commands.AddCommand("region", false, "show connections",
291 "show connections", 295 "show connections",
292 "Show connection data", HandleShow); 296 "Show connection data", HandleShow);
293 297
294 m_console.Commands.AddCommand("region", false, "show users full",
295 "show users full",
296 String.Empty, HandleShow);
297
298 m_console.Commands.AddCommand("region", false, "show modules", 298 m_console.Commands.AddCommand("region", false, "show modules",
299 "show modules", 299 "show modules",
300 "Show module data", HandleShow); 300 "Show module data", HandleShow);
@@ -304,8 +304,12 @@ namespace OpenSim
304 "Show region data", HandleShow); 304 "Show region data", HandleShow);
305 305
306 m_console.Commands.AddCommand("region", false, "show queues", 306 m_console.Commands.AddCommand("region", false, "show queues",
307 "show queues", 307 "show queues [full]",
308 "Show queue data", HandleShow); 308 "Show queue data for each client",
309 "Without the 'full' option, only users actually on the region are shown."
310 + " With the 'full' option child agents of users in neighbouring regions are also shown.",
311 HandleShow);
312
309 m_console.Commands.AddCommand("region", false, "show ratings", 313 m_console.Commands.AddCommand("region", false, "show ratings",
310 "show ratings", 314 "show ratings",
311 "Show rating data", HandleShow); 315 "Show rating data", HandleShow);
@@ -876,7 +880,7 @@ namespace OpenSim
876 { 880 {
877 agents = m_sceneManager.GetCurrentSceneAvatars(); 881 agents = m_sceneManager.GetCurrentSceneAvatars();
878 } 882 }
879 883
880 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); 884 MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
881 885
882 MainConsole.Instance.Output( 886 MainConsole.Instance.Output(
@@ -953,7 +957,7 @@ namespace OpenSim
953 break; 957 break;
954 958
955 case "queues": 959 case "queues":
956 Notice(GetQueuesReport()); 960 Notice(GetQueuesReport(showParams));
957 break; 961 break;
958 962
959 case "ratings": 963 case "ratings":
@@ -983,43 +987,91 @@ namespace OpenSim
983 } 987 }
984 988
985 /// <summary> 989 /// <summary>
986 /// print UDP Queue data for each client 990 /// Generate UDP Queue data report for each client
987 /// </summary> 991 /// </summary>
992 /// <param name="showParams"></param>
988 /// <returns></returns> 993 /// <returns></returns>
989 private string GetQueuesReport() 994 private string GetQueuesReport(string[] showParams)
990 { 995 {
991 string report = String.Empty; 996 bool showChildren = false;
992 997
993 m_sceneManager.ForEachScene(delegate(Scene scene) 998 if (showParams.Length > 1 && showParams[1] == "full")
994 { 999 showChildren = true;
995 scene.ForEachClient(delegate(IClientAPI client) 1000
996 { 1001 StringBuilder report = new StringBuilder();
997 if (client is IStatsCollector) 1002
998 { 1003 int columnPadding = 2;
999 report = report + client.FirstName + 1004 int maxNameLength = 18;
1000 " " + client.LastName; 1005 int maxRegionNameLength = 14;
1001 1006 int maxTypeLength = 4;
1002 IStatsCollector stats = 1007 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
1003 (IStatsCollector) client; 1008
1004 1009 report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", "");
1005 report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n", 1010 report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", "");
1006 "Send", 1011 report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", "");
1007 "In", 1012
1008 "Out", 1013 report.AppendFormat(
1009 "Resend", 1014 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1010 "Land", 1015 "Packets",
1011 "Wind", 1016 "Packets",
1012 "Cloud", 1017 "Bytes",
1013 "Task", 1018 "Bytes",
1014 "Texture", 1019 "Bytes",
1015 "Asset"); 1020 "Bytes",
1016 report = report + stats.Report() + 1021 "Bytes",
1017 "\n"; 1022 "Bytes",
1018 } 1023 "Bytes",
1019 }); 1024 "Bytes",
1020 }); 1025 "Bytes");
1021 1026
1022 return report; 1027 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
1028 report.AppendFormat(
1029 "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n",
1030 "Out",
1031 "In",
1032 "Unacked",
1033 "Resend",
1034 "Land",
1035 "Wind",
1036 "Cloud",
1037 "Task",
1038 "Texture",
1039 "Asset",
1040 "State");
1041
1042 m_sceneManager.ForEachScene(
1043 delegate(Scene scene)
1044 {
1045 scene.ForEachClient(
1046 delegate(IClientAPI client)
1047 {
1048 if (client is IStatsCollector)
1049 {
1050 bool isChild = scene.PresenceChildStatus(client.AgentId);
1051 if (isChild && !showChildren)
1052 return;
1053
1054 string name = client.Name;
1055 string regionName = scene.RegionInfo.RegionName;
1056
1057 report.AppendFormat(
1058 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
1059 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
1060 report.AppendFormat(
1061 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
1062 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
1063 report.AppendFormat(
1064 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}",
1065 isChild ? "Cd" : "Rt", "");
1066
1067 IStatsCollector stats = (IStatsCollector)client;
1068
1069 report.AppendLine(stats.Report());
1070 }
1071 });
1072 });
1073
1074 return report.ToString();
1023 } 1075 }
1024 1076
1025 /// <summary> 1077 /// <summary>