diff options
author | opensim mirror account | 2010-11-17 15:10:07 -0800 |
---|---|---|
committer | opensim mirror account | 2010-11-17 15:10:07 -0800 |
commit | bfe1f3fdf80b7bac1f60fde0d51e24d7b48e07b6 (patch) | |
tree | 569403f6304c368c9f582cac65511ffc6c815762 | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
parent | Make "show queues [full]" behave like "show users [full]" (diff) | |
download | opensim-SC_OLD-bfe1f3fdf80b7bac1f60fde0d51e24d7b48e07b6.zip opensim-SC_OLD-bfe1f3fdf80b7bac1f60fde0d51e24d7b48e07b6.tar.gz opensim-SC_OLD-bfe1f3fdf80b7bac1f60fde0d51e24d7b48e07b6.tar.bz2 opensim-SC_OLD-bfe1f3fdf80b7bac1f60fde0d51e24d7b48e07b6.tar.xz |
Merge branch 'master' of /var/git/opensim/
-rw-r--r-- | OpenSim/Framework/Util.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 138 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 9 |
4 files changed, 130 insertions, 48 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index addfe5d..e8f8e01 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -451,6 +451,14 @@ namespace OpenSim.Framework | |||
451 | return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); | 451 | return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); |
452 | } | 452 | } |
453 | 453 | ||
454 | /// <summary> | ||
455 | /// Are the co-ordinates of the new region visible from the old region? | ||
456 | /// </summary> | ||
457 | /// <param name="oldx">Old region x-coord</param> | ||
458 | /// <param name="newx">New region x-coord</param> | ||
459 | /// <param name="oldy">Old region y-coord</param> | ||
460 | /// <param name="newy">New region y-coord</param> | ||
461 | /// <returns></returns> | ||
454 | public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) | 462 | public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) |
455 | { | 463 | { |
456 | // Eventually this will be a function of the draw distance / camera position too. | 464 | // Eventually this will be a function of the draw distance / camera position too. |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index f80cb34..2c920f6 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | ||
33 | using System.Timers; | 34 | using System.Timers; |
34 | using log4net; | 35 | using log4net; |
35 | using Nini.Config; | 36 | using 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> |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index ca5a7bd..c4db5da 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | |||
@@ -246,11 +246,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
246 | throw new NotImplementedException(); | 246 | throw new NotImplementedException(); |
247 | } | 247 | } |
248 | 248 | ||
249 | /// <summary> | ||
250 | /// Return statistics information about client packet queues. | ||
251 | /// </summary> | ||
252 | /// | ||
253 | /// FIXME: This should really be done in a more sensible manner rather than sending back a formatted string. | ||
254 | /// | ||
255 | /// <returns></returns> | ||
249 | public string GetStats() | 256 | public string GetStats() |
250 | { | 257 | { |
251 | // TODO: ??? | 258 | return string.Format( |
252 | return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", | 259 | "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}", |
253 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | 260 | PacketsSent, |
261 | PacketsReceived, | ||
262 | UnackedBytes, | ||
263 | m_throttleCategories[(int)ThrottleOutPacketType.Resend].Content, | ||
264 | m_throttleCategories[(int)ThrottleOutPacketType.Land].Content, | ||
265 | m_throttleCategories[(int)ThrottleOutPacketType.Wind].Content, | ||
266 | m_throttleCategories[(int)ThrottleOutPacketType.Cloud].Content, | ||
267 | m_throttleCategories[(int)ThrottleOutPacketType.Task].Content, | ||
268 | m_throttleCategories[(int)ThrottleOutPacketType.Texture].Content, | ||
269 | m_throttleCategories[(int)ThrottleOutPacketType.Asset].Content, | ||
270 | m_throttleCategories[(int)ThrottleOutPacketType.State].Content); | ||
254 | } | 271 | } |
255 | 272 | ||
256 | public void SendPacketStats() | 273 | public void SendPacketStats() |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b5cab84..f02a922 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1228,11 +1228,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); | 1230 | m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); |
1231 | |||
1232 | } | 1231 | } |
1233 | |||
1234 | } | 1232 | } |
1235 | 1233 | ||
1234 | /// <summary> | ||
1235 | /// Return the list of regions that are considered to be neighbours to the given scene. | ||
1236 | /// </summary> | ||
1237 | /// <param name="pScene"></param> | ||
1238 | /// <param name="pRegionLocX"></param> | ||
1239 | /// <param name="pRegionLocY"></param> | ||
1240 | /// <returns></returns> | ||
1236 | protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) | 1241 | protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) |
1237 | { | 1242 | { |
1238 | RegionInfo m_regionInfo = pScene.RegionInfo; | 1243 | RegionInfo m_regionInfo = pScene.RegionInfo; |