aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
diff options
context:
space:
mode:
authorOren Hurvitz2014-06-29 18:49:27 +0300
committerOren Hurvitz2014-07-21 09:10:50 +0100
commitaf3498efdbd0b165a7e37095b1d8a9e54723993c (patch)
tree6ce955802b93f276b53e8a47f346222772e0a637 /OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
parentWrite UDP statistics to the log, not just the console (e.g., "show queues") (diff)
downloadopensim-SC-af3498efdbd0b165a7e37095b1d8a9e54723993c.zip
opensim-SC-af3498efdbd0b165a7e37095b1d8a9e54723993c.tar.gz
opensim-SC-af3498efdbd0b165a7e37095b1d8a9e54723993c.tar.bz2
opensim-SC-af3498efdbd0b165a7e37095b1d8a9e54723993c.tar.xz
In "show throttles", show the maximum drip rate. This shows whether a client is being throttled due to past poor performance.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
index 4c33db5..0d4f549 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -335,13 +335,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
335 // greater than this. 335 // greater than this.
336 // </summary> 336 // </summary>
337 protected Int64 m_maxDripRate = 0; 337 protected Int64 m_maxDripRate = 0;
338 protected Int64 MaxDripRate 338 public Int64 MaxDripRate
339 { 339 {
340 get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } 340 get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); }
341 set { m_maxDripRate = (value == 0 ? 0 : Math.Max(value,m_minimumFlow)); } 341 protected set { m_maxDripRate = (value == 0 ? 0 : Math.Max(value,m_minimumFlow)); }
342 } 342 }
343 343
344 private bool m_enabled = false; 344 public bool Enabled { get; private set; }
345 345
346 // <summary> 346 // <summary>
347 // 347 //
@@ -362,9 +362,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
362 // </summary> 362 // </summary>
363 public AdaptiveTokenBucket(TokenBucket parent, Int64 maxDripRate, bool enabled) : base(parent,maxDripRate) 363 public AdaptiveTokenBucket(TokenBucket parent, Int64 maxDripRate, bool enabled) : base(parent,maxDripRate)
364 { 364 {
365 m_enabled = enabled; 365 Enabled = enabled;
366 366
367 if (m_enabled) 367 if (Enabled)
368 { 368 {
369 // m_log.DebugFormat("[TOKENBUCKET] Adaptive throttle enabled"); 369 // m_log.DebugFormat("[TOKENBUCKET] Adaptive throttle enabled");
370 MaxDripRate = maxDripRate; 370 MaxDripRate = maxDripRate;
@@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
378 public void ExpirePackets(Int32 count) 378 public void ExpirePackets(Int32 count)
379 { 379 {
380 // m_log.WarnFormat("[ADAPTIVEBUCKET] drop {0} by {1} expired packets",AdjustedDripRate,count); 380 // m_log.WarnFormat("[ADAPTIVEBUCKET] drop {0} by {1} expired packets",AdjustedDripRate,count);
381 if (m_enabled) 381 if (Enabled)
382 AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,count)); 382 AdjustedDripRate = (Int64) (AdjustedDripRate / Math.Pow(2,count));
383 } 383 }
384 384
@@ -387,7 +387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
387 // </summary> 387 // </summary>
388 public void AcknowledgePackets(Int32 count) 388 public void AcknowledgePackets(Int32 count)
389 { 389 {
390 if (m_enabled) 390 if (Enabled)
391 AdjustedDripRate = AdjustedDripRate + count; 391 AdjustedDripRate = AdjustedDripRate + count;
392 } 392 }
393 } 393 }