aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs101
1 files changed, 69 insertions, 32 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index f80cb34..c20a4e8 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;
@@ -988,38 +989,74 @@ namespace OpenSim
988 /// <returns></returns> 989 /// <returns></returns>
989 private string GetQueuesReport() 990 private string GetQueuesReport()
990 { 991 {
991 string report = String.Empty; 992 StringBuilder report = new StringBuilder();
992 993
993 m_sceneManager.ForEachScene(delegate(Scene scene) 994 int columnPadding = 2;
994 { 995 int maxNameLength = 18;
995 scene.ForEachClient(delegate(IClientAPI client) 996 int maxRegionNameLength = 14;
996 { 997 int maxTypeLength = 5;
997 if (client is IStatsCollector) 998 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
998 { 999
999 report = report + client.FirstName + 1000 report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", "");
1000 " " + client.LastName; 1001 report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", "");
1001 1002 report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", "");
1002 IStatsCollector stats = 1003
1003 (IStatsCollector) client; 1004 report.AppendFormat(
1004 1005 "{0,9} {1,10} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7} {9,7}\n",
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", 1006 "Packets",
1006 "Send", 1007 "Packets",
1007 "In", 1008 "Bytes",
1008 "Out", 1009 "Bytes",
1009 "Resend", 1010 "Bytes",
1010 "Land", 1011 "Bytes",
1011 "Wind", 1012 "Bytes",
1012 "Cloud", 1013 "Bytes",
1013 "Task", 1014 "Bytes",
1014 "Texture", 1015 "Bytes");
1015 "Asset"); 1016
1016 report = report + stats.Report() + 1017 report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", "");
1017 "\n"; 1018 report.AppendFormat(
1018 } 1019 "{0,9} {1,10} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7} {9,7}\n",
1019 }); 1020 "Sent",
1020 }); 1021 "Received",
1021 1022 "Resend",
1022 return report; 1023 "Land",
1024 "Wind",
1025 "Cloud",
1026 "Task",
1027 "Texture",
1028 "Asset",
1029 "State");
1030
1031 m_sceneManager.ForEachScene(
1032 delegate(Scene scene)
1033 {
1034 scene.ForEachClient(
1035 delegate(IClientAPI client)
1036 {
1037 if (client is IStatsCollector)
1038 {
1039 string name = client.Name;
1040 string regionName = scene.RegionInfo.RegionName;
1041
1042 report.AppendFormat(
1043 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
1044 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
1045 report.AppendFormat(
1046 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
1047 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
1048 report.AppendFormat(
1049 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}",
1050 scene.PresenceChildStatus(client.AgentId) ? "Child" : "Root", "");
1051
1052 IStatsCollector stats = (IStatsCollector)client;
1053
1054 report.AppendLine(stats.Report());
1055 }
1056 });
1057 });
1058
1059 return report.ToString();
1023 } 1060 }
1024 1061
1025 /// <summary> 1062 /// <summary>