aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-09-30 18:12:51 +0100
committerJustin Clark-Casey (justincc)2014-10-02 22:30:44 +0100
commit05508b5c5610c5f56233d26aba46ee361fcab667 (patch)
tree852dda9602b6902c18ae1974320df87867cb7b50 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
parentDon't unnecessarily remove from backup objects that were not directly attache... (diff)
downloadopensim-SC_OLD-05508b5c5610c5f56233d26aba46ee361fcab667.zip
opensim-SC_OLD-05508b5c5610c5f56233d26aba46ee361fcab667.tar.gz
opensim-SC_OLD-05508b5c5610c5f56233d26aba46ee361fcab667.tar.bz2
opensim-SC_OLD-05508b5c5610c5f56233d26aba46ee361fcab667.tar.xz
Add "debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>" to control extra throttle related debug logging.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs47
1 files changed, 42 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 9dc9e0d..d8ca343 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -82,6 +82,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
82 /// <remarks>Any level above 0 will turn on logging.</remarks> 82 /// <remarks>Any level above 0 will turn on logging.</remarks>
83 public int DebugDataOutLevel { get; set; } 83 public int DebugDataOutLevel { get; set; }
84 84
85 /// <summary>
86 /// Controls whether information is logged about each outbound packet immediately before it is sent. For debug purposes.
87 /// </summary>
88 /// <remarks>Any level above 0 will turn on logging.</remarks>
89 public int ThrottleDebugLevel
90 {
91 get
92 {
93 return m_throttleDebugLevel;
94 }
95
96 set
97 {
98 m_throttleDebugLevel = value;
99 m_throttleClient.DebugLevel = m_throttleDebugLevel;
100 m_throttleCategory.DebugLevel = m_throttleDebugLevel;
101 foreach (TokenBucket tb in m_throttleCategories)
102 tb.DebugLevel = m_throttleDebugLevel;
103 }
104 }
105 private int m_throttleDebugLevel;
106
85 /// <summary>Fired when updated networking stats are produced for this client</summary> 107 /// <summary>Fired when updated networking stats are produced for this client</summary>
86 public event PacketStats OnPacketStats; 108 public event PacketStats OnPacketStats;
87 /// <summary>Fired when the queue for a packet category is empty. This event can be 109 /// <summary>Fired when the queue for a packet category is empty. This event can be
@@ -207,9 +229,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
207 m_maxRTO = maxRTO; 229 m_maxRTO = maxRTO;
208 230
209 // Create a token bucket throttle for this client that has the scene token bucket as a parent 231 // Create a token bucket throttle for this client that has the scene token bucket as a parent
210 m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled); 232 m_throttleClient
233 = new AdaptiveTokenBucket(
234 string.Format("adaptive throttle for {0} in {1}", AgentID, server.Scene.Name),
235 parentThrottle, rates.Total, rates.AdaptiveThrottlesEnabled);
236
211 // Create a token bucket throttle for the total category with the client bucket as a throttle 237 // Create a token bucket throttle for the total category with the client bucket as a throttle
212 m_throttleCategory = new TokenBucket(m_throttleClient, 0); 238 m_throttleCategory
239 = new TokenBucket(
240 string.Format("total throttle for {0} in {1}", AgentID, server.Scene.Name),
241 m_throttleClient, 0);
242
213 // Create an array of token buckets for this clients different throttle categories 243 // Create an array of token buckets for this clients different throttle categories
214 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; 244 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
215 245
@@ -221,8 +251,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
221 251
222 // Initialize the packet outboxes, where packets sit while they are waiting for tokens 252 // Initialize the packet outboxes, where packets sit while they are waiting for tokens
223 m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); 253 m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>();
254
224 // Initialize the token buckets that control the throttling for each category 255 // Initialize the token buckets that control the throttling for each category
225 m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); 256 m_throttleCategories[i]
257 = new TokenBucket(
258 string.Format("{0} throttle for {1} in {2}", type, AgentID, server.Scene.Name),
259 m_throttleCategory, rates.GetRate(type));
226 } 260 }
227 261
228 // Default the retransmission timeout to one second 262 // Default the retransmission timeout to one second
@@ -371,8 +405,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
371 texture = (int)((1 - m_cannibalrate) * texture); 405 texture = (int)((1 - m_cannibalrate) * texture);
372 406
373 //int total = resend + land + wind + cloud + task + texture + asset; 407 //int total = resend + land + wind + cloud + task + texture + asset;
374 //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", 408
375 // AgentID, resend, land, wind, cloud, task, texture, asset, total); 409 if (ThrottleDebugLevel > 0)
410 m_log.DebugFormat(
411 "[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}",
412 AgentID, m_udpServer.Scene.Name, resend, land, wind, cloud, task, texture, asset);
376 413
377 // Update the token buckets with new throttle values 414 // Update the token buckets with new throttle values
378 TokenBucket bucket; 415 TokenBucket bucket;