aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs (renamed from OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs)150
-rw-r--r--prebuild.xml109
4 files changed, 201 insertions, 67 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e43e3c9..5dab1bc 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -368,6 +368,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
368 #region Properties 368 #region Properties
369 369
370 public LLUDPClient UDPClient { get { return m_udpClient; } } 370 public LLUDPClient UDPClient { get { return m_udpClient; } }
371 public LLUDPServer UDPServer { get { return m_udpServer; } }
371 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } } 372 public IPEndPoint RemoteEndPoint { get { return m_udpClient.RemoteEndPoint; } }
372 public UUID SecureSessionId { get { return m_secureSessionId; } } 373 public UUID SecureSessionId { get { return m_secureSessionId; } }
373 public IScene Scene { get { return m_scene; } } 374 public IScene Scene { get { return m_scene; } }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 571624b..df8ddbb 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -114,8 +114,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
114 //private UDPClientCollection m_clients = new UDPClientCollection(); 114 //private UDPClientCollection m_clients = new UDPClientCollection();
115 /// <summary>Bandwidth throttle for this UDP server</summary> 115 /// <summary>Bandwidth throttle for this UDP server</summary>
116 protected TokenBucket m_throttle; 116 protected TokenBucket m_throttle;
117
117 /// <summary>Bandwidth throttle rates for this UDP server</summary> 118 /// <summary>Bandwidth throttle rates for this UDP server</summary>
118 protected ThrottleRates m_throttleRates; 119 public ThrottleRates ThrottleRates { get; private set; }
120
119 /// <summary>Manages authentication for agent circuits</summary> 121 /// <summary>Manages authentication for agent circuits</summary>
120 private AgentCircuitManager m_circuitManager; 122 private AgentCircuitManager m_circuitManager;
121 /// <summary>Reference to the scene this UDP server is attached to</summary> 123 /// <summary>Reference to the scene this UDP server is attached to</summary>
@@ -226,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
226 #endregion BinaryStats 228 #endregion BinaryStats
227 229
228 m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps); 230 m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps);
229 m_throttleRates = new ThrottleRates(configSource); 231 ThrottleRates = new ThrottleRates(configSource);
230 } 232 }
231 233
232 public void Start() 234 public void Start()
@@ -922,7 +924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
922 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) 924 protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
923 { 925 {
924 // Create the LLUDPClient 926 // Create the LLUDPClient
925 LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); 927 LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
926 IClientAPI existingClient; 928 IClientAPI existingClient;
927 929
928 if (!m_scene.TryGetClient(agentID, out existingClient)) 930 if (!m_scene.TryGetClient(agentID, out existingClient))
diff --git a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 29583dc..480df31 100644
--- a/OpenSim/Region/CoreModules/Agent/UDP/Linden/LindenUDPModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -36,19 +36,20 @@ using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Console; 37using OpenSim.Framework.Console;
38using OpenSim.Framework.Statistics; 38using OpenSim.Framework.Statistics;
39using OpenSim.Region.ClientStack.LindenUDP;
39using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 41using OpenSim.Region.Framework.Scenes;
41 42
42namespace OpenSim.Region.CoreModules.UDP.Linden 43namespace OpenSim.Region.CoreModules.UDP.Linden
43{ 44{
44 /// <summary> 45 /// <summary>
45 /// A module that just holds commands for inspecting/changing the Linden UDP client stack 46 /// A module that just holds commands for inspecting the current state of the Linden UDP stack.
46 /// </summary> 47 /// </summary>
47 /// <remarks> 48 /// <remarks>
48 /// All actual client stack functionality remains in OpenSim.Region.ClientStack.LindenUDP 49 /// All actual client stack functionality remains in OpenSim.Region.ClientStack.LindenUDP
49 /// </remarks> 50 /// </remarks>
50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LindenUDPModule")] 51 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LindenUDPInfoModule")]
51 public class LindenUDPModule : ISharedRegionModule 52 public class LindenUDPInfoModule : ISharedRegionModule
52 { 53 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 55
@@ -60,22 +61,22 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
60 61
61 public void Initialise(IConfigSource source) 62 public void Initialise(IConfigSource source)
62 { 63 {
63// m_log.DebugFormat("[LINDEN UDP MODULE]: INITIALIZED MODULE"); 64// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: INITIALIZED MODULE");
64 } 65 }
65 66
66 public void PostInitialise() 67 public void PostInitialise()
67 { 68 {
68// m_log.DebugFormat("[LINDEN UDP MODULE]: POST INITIALIZED MODULE"); 69// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: POST INITIALIZED MODULE");
69 } 70 }
70 71
71 public void Close() 72 public void Close()
72 { 73 {
73// m_log.DebugFormat("[LINDEN UDP MODULE]: CLOSED MODULE"); 74// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: CLOSED MODULE");
74 } 75 }
75 76
76 public void AddRegion(Scene scene) 77 public void AddRegion(Scene scene)
77 { 78 {
78// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); 79// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
79 80
80 lock (m_scenes) 81 lock (m_scenes)
81 m_scenes[scene.RegionInfo.RegionID] = scene; 82 m_scenes[scene.RegionInfo.RegionID] = scene;
@@ -86,12 +87,20 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
86 "Show queue data for each client", 87 "Show queue data for each client",
87 "Without the 'full' option, only root agents are shown." 88 "Without the 'full' option, only root agents are shown."
88 + " With the 'full' option child agents are also shown.", 89 + " With the 'full' option child agents are also shown.",
89 ShowQueuesReport); 90 ShowQueuesReport);
91
92 scene.AddCommand(
93 this, "show throttles",
94 "show throttles [full]",
95 "Show throttle settings for each client and for the server overall",
96 "Without the 'full' option, only root agents are shown."
97 + " With the 'full' option child agents are also shown.",
98 ShowThrottlesReport);
90 } 99 }
91 100
92 public void RemoveRegion(Scene scene) 101 public void RemoveRegion(Scene scene)
93 { 102 {
94// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); 103// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
95 104
96 lock (m_scenes) 105 lock (m_scenes)
97 m_scenes.Remove(scene.RegionInfo.RegionID); 106 m_scenes.Remove(scene.RegionInfo.RegionID);
@@ -99,7 +108,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
99 108
100 public void RegionLoaded(Scene scene) 109 public void RegionLoaded(Scene scene)
101 { 110 {
102// m_log.DebugFormat("[LINDEN UDP MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 111// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
103 } 112 }
104 113
105 protected void ShowQueuesReport(string module, string[] cmd) 114 protected void ShowQueuesReport(string module, string[] cmd)
@@ -107,6 +116,11 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
107 MainConsole.Instance.Output(GetQueuesReport(cmd)); 116 MainConsole.Instance.Output(GetQueuesReport(cmd));
108 } 117 }
109 118
119 protected void ShowThrottlesReport(string module, string[] cmd)
120 {
121 MainConsole.Instance.Output(GetThrottlesReport(cmd));
122 }
123
110 /// <summary> 124 /// <summary>
111 /// Generate UDP Queue data report for each client 125 /// Generate UDP Queue data report for each client
112 /// </summary> 126 /// </summary>
@@ -195,6 +209,122 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
195 } 209 }
196 210
197 return report.ToString(); 211 return report.ToString();
212 }
213
214 /// <summary>
215 /// Show throttle data
216 /// </summary>
217 /// <param name="showParams"></param>
218 /// <returns></returns>
219 protected string GetThrottlesReport(string[] showParams)
220 {
221 bool showChildren = false;
222
223 if (showParams.Length > 2 && showParams[2] == "full")
224 showChildren = true;
225
226 StringBuilder report = new StringBuilder();
227
228 int columnPadding = 2;
229 int maxNameLength = 18;
230 int maxRegionNameLength = 14;
231 int maxTypeLength = 4;
232 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
233
234 report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", "");
235 report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", "");
236 report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type\n", "");
237
238 bool firstClient = true;
239
240 lock (m_scenes)
241 {
242 foreach (Scene scene in m_scenes.Values)
243 {
244 scene.ForEachClient(
245 delegate(IClientAPI client)
246 {
247 if (client is LLClientView)
248 {
249 LLClientView llClient = client as LLClientView;
250
251 if (firstClient)
252 {
253 report.AppendLine(GetServerThrottlesReport(llClient.UDPServer, scene));
254 firstClient = false;
255 }
256
257 bool isChild = scene.PresenceChildStatus(client.AgentId);
258 if (isChild && !showChildren)
259 return;
260
261 string name = client.Name;
262 string regionName = scene.RegionInfo.RegionName;
263
264 LLUDPClient llUdpClient = llClient.UDPClient;
265 ClientInfo ci = llUdpClient.GetClientInfo();
266
267 report.AppendFormat(
268 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
269 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
270 report.AppendFormat(
271 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
272 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
273 report.AppendFormat(
274 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}",
275 isChild ? "Cd" : "Rt", "");
276
277 report.Append((ci.totalThrottle * 8) / 1000 + " ");
278 report.Append((ci.resendThrottle * 8) / 1000 + " ");
279 report.Append((ci.landThrottle * 8) / 1000 + " ");
280 report.Append((ci.windThrottle * 8) / 1000 + " ");
281 report.Append((ci.cloudThrottle * 8) / 1000 + " ");
282 report.Append((ci.taskThrottle * 8) / 1000 + " ");
283 report.Append((ci.textureThrottle * 8) / 1000 + " ");
284 report.Append((ci.assetThrottle * 8) / 1000 + " ");
285
286 report.AppendLine();
287 }
288 });
289 }
290 }
291
292 return report.ToString();
198 } 293 }
294
295 protected string GetServerThrottlesReport(LLUDPServer udpServer, Scene scene)
296 {
297 StringBuilder report = new StringBuilder();
298
299 int columnPadding = 2;
300 int maxNameLength = 18;
301 int maxRegionNameLength = 14;
302 int maxTypeLength = 4;
303 int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding;
304
305 string name = "SERVER LIMITS";
306 string regionName = scene.RegionInfo.RegionName;
307
308 report.AppendFormat(
309 "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}",
310 name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, "");
311 report.AppendFormat(
312 "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}",
313 regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, "");
314 report.AppendFormat(
315 "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "n/a", "");
316
317 ThrottleRates throttleRates = udpServer.ThrottleRates;
318 report.Append("n/a");
319 report.Append((throttleRates.ResendLimit * 8) / 1000 + " ");
320 report.Append((throttleRates.LandLimit * 8) / 1000 + " ");
321 report.Append((throttleRates.WindLimit * 8) / 1000 + " ");
322 report.Append((throttleRates.CloudLimit * 8) / 1000 + " ");
323 report.Append((throttleRates.TaskLimit * 8) / 1000 + " ");
324 report.Append((throttleRates.TextureLimit * 8) / 1000 + " ");
325 report.Append((throttleRates.AssetLimit * 8) / 1000 + " ");
326
327 return report.ToString();
328 }
199 } 329 }
200} \ No newline at end of file 330} \ No newline at end of file
diff --git a/prebuild.xml b/prebuild.xml
index 73cc81e..0d6d6fb 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1439,60 +1439,6 @@
1439 </Files> 1439 </Files>
1440 </Project> 1440 </Project>
1441 1441
1442 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library">
1443 <Configuration name="Debug">
1444 <Options>
1445 <OutputPath>../../../bin/</OutputPath>
1446 </Options>
1447 </Configuration>
1448 <Configuration name="Release">
1449 <Options>
1450 <OutputPath>../../../bin/</OutputPath>
1451 </Options>
1452 </Configuration>
1453
1454 <ReferencePath>../../../bin/</ReferencePath>
1455 <Reference name="System"/>
1456 <Reference name="System.Xml"/>
1457 <Reference name="System.Drawing"/>
1458 <Reference name="System.Web"/>
1459 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
1460 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
1461 <Reference name="OpenMetaverse" path="../../../bin/"/>
1462 <Reference name="PumaCode.SvnDotNet" path="../../../bin/"/>
1463 <Reference name="OpenSim.Framework"/>
1464 <Reference name="OpenSim.Framework.Communications"/>
1465 <Reference name="OpenSim.Data"/>
1466 <Reference name="OpenSim.Region.Framework"/>
1467 <Reference name="OpenSim.Region.CoreModules"/>
1468 <Reference name="OpenSim.Framework.Capabilities"/>
1469 <Reference name="OpenSim.Framework.Console"/>
1470 <Reference name="OpenSim.Framework.Servers"/>
1471 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1472 <Reference name="OpenSim.Framework.Statistics"/>
1473 <Reference name="OpenSim.Region.Physics.Manager"/>
1474 <Reference name="OpenSim.Server.Base"/>
1475 <Reference name="OpenSim.Server.Handlers"/>
1476 <Reference name="OpenSim.Services.Connectors"/>
1477 <Reference name="OpenSim.Services.Base"/>
1478 <Reference name="OpenSim.Services.Interfaces"/>
1479 <Reference name="Mono.Addins" path="../../../bin/"/>
1480
1481 <!-- For scripting in funny languages by default -->
1482 <Reference name="XMLRPC" path="../../../bin/"/>
1483 <Reference name="OpenSim.Framework.Communications"/>
1484 <Reference name="Nini" path="../../../bin/"/>
1485 <Reference name="log4net" path="../../../bin/"/>
1486 <Reference name="DotNetOpenMail" path="../../../bin/"/>
1487
1488 <Files>
1489 <Match pattern="*.cs" recurse="true">
1490 <Exclude name="Tests" pattern="Tests"/>
1491 </Match>
1492 <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/>
1493 </Files>
1494 </Project>
1495
1496 <Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library"> 1442 <Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library">
1497 <Configuration name="Debug"> 1443 <Configuration name="Debug">
1498 <Options> 1444 <Options>
@@ -1606,6 +1552,61 @@
1606 </Files> 1552 </Files>
1607 </Project> 1553 </Project>
1608 1554
1555 <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library">
1556 <Configuration name="Debug">
1557 <Options>
1558 <OutputPath>../../../bin/</OutputPath>
1559 </Options>
1560 </Configuration>
1561 <Configuration name="Release">
1562 <Options>
1563 <OutputPath>../../../bin/</OutputPath>
1564 </Options>
1565 </Configuration>
1566
1567 <ReferencePath>../../../bin/</ReferencePath>
1568 <Reference name="System"/>
1569 <Reference name="System.Xml"/>
1570 <Reference name="System.Drawing"/>
1571 <Reference name="System.Web"/>
1572 <Reference name="OpenMetaverseTypes" path="../../../bin/"/>
1573 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
1574 <Reference name="OpenMetaverse" path="../../../bin/"/>
1575 <Reference name="PumaCode.SvnDotNet" path="../../../bin/"/>
1576 <Reference name="OpenSim.Framework"/>
1577 <Reference name="OpenSim.Framework.Communications"/>
1578 <Reference name="OpenSim.Data"/>
1579 <Reference name="OpenSim.Framework.Capabilities"/>
1580 <Reference name="OpenSim.Framework.Console"/>
1581 <Reference name="OpenSim.Framework.Servers"/>
1582 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1583 <Reference name="OpenSim.Framework.Statistics"/>
1584 <Reference name="OpenSim.Region.ClientStack.LindenUDP"/>
1585 <Reference name="OpenSim.Region.CoreModules"/>
1586 <Reference name="OpenSim.Region.Framework"/>
1587 <Reference name="OpenSim.Region.Physics.Manager"/>
1588 <Reference name="OpenSim.Server.Base"/>
1589 <Reference name="OpenSim.Server.Handlers"/>
1590 <Reference name="OpenSim.Services.Connectors"/>
1591 <Reference name="OpenSim.Services.Base"/>
1592 <Reference name="OpenSim.Services.Interfaces"/>
1593 <Reference name="Mono.Addins" path="../../../bin/"/>
1594
1595 <!-- For scripting in funny languages by default -->
1596 <Reference name="XMLRPC" path="../../../bin/"/>
1597 <Reference name="OpenSim.Framework.Communications"/>
1598 <Reference name="Nini" path="../../../bin/"/>
1599 <Reference name="log4net" path="../../../bin/"/>
1600 <Reference name="DotNetOpenMail" path="../../../bin/"/>
1601
1602 <Files>
1603 <Match pattern="*.cs" recurse="true">
1604 <Exclude name="Tests" pattern="Tests"/>
1605 </Match>
1606 <Match buildAction="EmbeddedResource" path="Resources" pattern="*.addin.xml" recurse="true"/>
1607 </Files>
1608 </Project>
1609
1609 <!-- Datastore Plugins --> 1610 <!-- Datastore Plugins -->
1610 <Project frameworkVersion="v3_5" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library"> 1611 <Project frameworkVersion="v3_5" name="OpenSim.Data.Null" path="OpenSim/Data/Null" type="Library">
1611 <Configuration name="Debug"> 1612 <Configuration name="Debug">