A hierarchical token bucket for bandwidth throttling. See http://en.wikipedia.org/wiki/Token_bucket for more information
More...
|
float | DripRateModifier () |
| Compute a modifier for the MaxBurst rate. This is 1.0, meaning no modification if the requested bandwidth is less than the max burst bandwidth all the way to the root of the throttle hierarchy. However, if any of the parents is over-booked, then the modifier will be less than 1. More...
|
|
float | BurstModifier () |
|
void | Drip () |
| Add tokens to the bucket over time. The number of tokens added each call depends on the length of time that has passed since the last call to Drip More...
|
|
|
const float | m_timeScale = 1e-3f |
|
const float | m_quantumsPerBurst = 5 |
| This is the number of m_minimumDripRate bytes allowed in a burst roughtly, with this settings, the maximum time system will take to recheck a bucket in ms More...
|
|
const float | m_minimumDripRate = 1500 |
|
Int32 | m_lastDrip |
| Time of the last drip, in system ticks More...
|
|
float | m_tokenCount |
| The number of bytes that can be sent at this moment. This is the current number of tokens in the bucket More...
|
|
Dictionary< TokenBucket, float > | m_children = new Dictionary<TokenBucket, float>() |
| Map of children buckets and their requested maximum burst rate More...
|
|
TokenBucket | m_parent |
| The parent bucket of this bucket, or null if this bucket has no parent. The parent bucket will limit the aggregate bandwidth of all of its children buckets More...
|
|
float | m_burst |
| This is the maximum number of tokens that can accumulate in the bucket at any one time. This also sets the total request for leaf nodes More...
|
|
float | m_dripRate |
| The requested drip rate for this particular bucket. More...
|
|
float | m_totalDripRequest |
| The current total of the requested maximum burst rates of children buckets. More...
|
|
A hierarchical token bucket for bandwidth throttling. See http://en.wikipedia.org/wiki/Token_bucket for more information
Definition at line 42 of file TokenBucket.cs.
OpenSim.Region.ClientStack.LindenUDP.TokenBucket.TokenBucket |
( |
TokenBucket |
parent, |
|
|
float |
dripRate, |
|
|
float |
MaxBurst |
|
) |
| |
|
inline |
Default constructor
- Parameters
-
identifier | Identifier for this token bucket |
parent | Parent bucket if this is a child bucket, or null if this is a root bucket |
maxBurst | Maximum size of the bucket in bytes, or zero if this bucket has no maximum capacity |
dripRate | Rate that the bucket fills, in bytes per second. If zero, the bucket always remains full |
Definition at line 189 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.BurstModifier |
( |
| ) |
|
|
inlineprotected |
bool OpenSim.Region.ClientStack.LindenUDP.TokenBucket.CheckTokens |
( |
int |
amount | ) |
|
|
inline |
void OpenSim.Region.ClientStack.LindenUDP.TokenBucket.Drip |
( |
| ) |
|
|
inlineprotected |
Add tokens to the bucket over time. The number of tokens added each call depends on the length of time that has passed since the last call to Drip
- Returns
- True if tokens were added to the bucket, otherwise false
Definition at line 306 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.DripRateModifier |
( |
| ) |
|
|
inlineprotected |
Compute a modifier for the MaxBurst rate. This is 1.0, meaning no modification if the requested bandwidth is less than the max burst bandwidth all the way to the root of the throttle hierarchy. However, if any of the parents is over-booked, then the modifier will be less than 1.
Definition at line 210 of file TokenBucket.cs.
int OpenSim.Region.ClientStack.LindenUDP.TokenBucket.GetCatBytesCanSend |
( |
int |
timeMS | ) |
|
|
inline |
void OpenSim.Region.ClientStack.LindenUDP.TokenBucket.RegisterRequest |
( |
TokenBucket |
child, |
|
|
float |
request |
|
) |
| |
|
inline |
Register drip rate requested by a child of this throttle. Pass the changes up the hierarchy.
Definition at line 230 of file TokenBucket.cs.
bool OpenSim.Region.ClientStack.LindenUDP.TokenBucket.RemoveTokens |
( |
int |
amount | ) |
|
|
inline |
Remove a given number of tokens from the bucket
- Parameters
-
amount | Number of tokens to remove from the bucket |
- Returns
- True if the requested number of tokens were removed from the bucket, otherwise false
Definition at line 272 of file TokenBucket.cs.
void OpenSim.Region.ClientStack.LindenUDP.TokenBucket.UnregisterRequest |
( |
TokenBucket |
child | ) |
|
|
inline |
Remove the rate requested by a child of this throttle. Pass the changes up the hierarchy.
Definition at line 250 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_burst |
|
protected |
This is the maximum number of tokens that can accumulate in the bucket at any one time. This also sets the total request for leaf nodes
Definition at line 98 of file TokenBucket.cs.
Dictionary<TokenBucket, float> OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_children = new Dictionary<TokenBucket, float>() |
|
protected |
Map of children buckets and their requested maximum burst rate
Definition at line 78 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_dripRate |
|
protected |
The requested drip rate for this particular bucket.
0 then TotalDripRequest is used instead. Can never be above MaxDripRate. Tokens are added to the bucket at any time
- See Also
- RemoveTokens
is called, at the granularity of the system tick interval (typically around 15-22ms)
Definition at line 135 of file TokenBucket.cs.
Int32 OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_lastDrip |
|
protected |
Time of the last drip, in system ticks
Definition at line 66 of file TokenBucket.cs.
const float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_minimumDripRate = 1500 |
|
protected |
TokenBucket OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_parent |
|
protected |
The parent bucket of this bucket, or null if this bucket has no parent. The parent bucket will limit the aggregate bandwidth of all of its children buckets
Definition at line 87 of file TokenBucket.cs.
const float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_quantumsPerBurst = 5 |
|
protected |
This is the number of m_minimumDripRate bytes allowed in a burst roughtly, with this settings, the maximum time system will take to recheck a bucket in ms
Definition at line 59 of file TokenBucket.cs.
const float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_timeScale = 1e-3f |
|
protected |
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_tokenCount |
|
protected |
The number of bytes that can be sent at this moment. This is the current number of tokens in the bucket
Definition at line 72 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.m_totalDripRequest |
|
protected |
The current total of the requested maximum burst rates of children buckets.
Definition at line 167 of file TokenBucket.cs.
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.Burst |
|
get |
virtual float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.DripRate |
|
get |
virtual float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.MaxDripRate |
|
getset |
TokenBucket OpenSim.Region.ClientStack.LindenUDP.TokenBucket.Parent |
|
getset |
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.RequestedBurst |
|
getset |
virtual float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.RequestedDripRate |
|
getset |
float OpenSim.Region.ClientStack.LindenUDP.TokenBucket.TotalDripRequest |
|
getset |
The documentation for this class was generated from the following file: