Lean  $LEAN_TAG$
QuantConnect.Packets.LeakyBucketControlParameters Class Reference

Provides parameters that control the behavior of a leaky bucket rate limiting algorithm. The parameter names below are phrased in the positive, such that the bucket is filled up over time vs leaking out over time. More...

Public Member Functions

 LeakyBucketControlParameters ()
 Initializes a new instance of the LeakyBucketControlParameters using default values More...
 
 LeakyBucketControlParameters (int capacity, int refillAmount, int timeIntervalMinutes)
 Initializes a new instance of the LeakyBucketControlParameters with the specified value More...
 

Public Attributes

int Capacity
 Sets the total capacity of the bucket in a leaky bucket algorithm. This is the maximum number of 'units' the bucket can hold and also defines the maximum burst rate, assuming instantaneous usage of 'units'. In reality, the usage of 'units' takes times, and so it is possible for the bucket to incrementally refill while consuming from the bucket. More...
 
int RefillAmount
 Sets the refill amount of the bucket. This defines the quantity of 'units' that become available to a consuming entity after the time interval has elapsed. For example, if the refill amount is equal to one, then each time interval one new 'unit' will be made available for a consumer that is throttled by the leaky bucket. More...
 
int TimeIntervalMinutes
 Sets the time interval for the refill amount of the bucket, in minutes. After this amount of wall-clock time has passed, the bucket will refill the refill amount, thereby making more 'units' available for a consumer. For example, if the refill amount equals 10 and the time interval is 30 minutes, then every 30 minutes, 10 more 'units' become available for a consumer. The available 'units' will continue to increase until the bucket capacity is reached. More...
 

Static Public Attributes

static int DefaultCapacity = Config.GetInt("scheduled-event-leaky-bucket-capacity", 2 * 60)
 Default capacity for leaky bucket More...
 
static int DefaultTimeInterval = Config.GetInt("scheduled-event-leaky-bucket-time-interval-minutes", 1440)
 Default time interval More...
 
static int DefaultRefillAmount = Config.GetInt("scheduled-event-leaky-bucket-refill-amount", (int)Math.Ceiling(DefaultCapacity/7.0))
 Default refill amount More...
 

Detailed Description

Provides parameters that control the behavior of a leaky bucket rate limiting algorithm. The parameter names below are phrased in the positive, such that the bucket is filled up over time vs leaking out over time.

Definition at line 28 of file LeakyBucketControlParameters.cs.

Constructor & Destructor Documentation

◆ LeakyBucketControlParameters() [1/2]

QuantConnect.Packets.LeakyBucketControlParameters.LeakyBucketControlParameters ( )

Initializes a new instance of the LeakyBucketControlParameters using default values

Definition at line 80 of file LeakyBucketControlParameters.cs.

◆ LeakyBucketControlParameters() [2/2]

QuantConnect.Packets.LeakyBucketControlParameters.LeakyBucketControlParameters ( int  capacity,
int  refillAmount,
int  timeIntervalMinutes 
)

Initializes a new instance of the LeakyBucketControlParameters with the specified value

Parameters
capacityThe total capacity of the bucket in minutes
refillAmountThe number of additional minutes to add to the bucket after timeIntervalMinutes has elapsed
timeIntervalMinutesThe interval, in minutes, that must pass before the refillAmount is added back to the bucket for reuse

Definition at line 95 of file LeakyBucketControlParameters.cs.

Member Data Documentation

◆ DefaultCapacity

int QuantConnect.Packets.LeakyBucketControlParameters.DefaultCapacity = Config.GetInt("scheduled-event-leaky-bucket-capacity", 2 * 60)
static

Default capacity for leaky bucket

Definition at line 37 of file LeakyBucketControlParameters.cs.

◆ DefaultTimeInterval

int QuantConnect.Packets.LeakyBucketControlParameters.DefaultTimeInterval = Config.GetInt("scheduled-event-leaky-bucket-time-interval-minutes", 1440)
static

Default time interval

Definition at line 42 of file LeakyBucketControlParameters.cs.

◆ DefaultRefillAmount

int QuantConnect.Packets.LeakyBucketControlParameters.DefaultRefillAmount = Config.GetInt("scheduled-event-leaky-bucket-refill-amount", (int)Math.Ceiling(DefaultCapacity/7.0))
static

Default refill amount

Definition at line 47 of file LeakyBucketControlParameters.cs.

◆ Capacity

int QuantConnect.Packets.LeakyBucketControlParameters.Capacity

Sets the total capacity of the bucket in a leaky bucket algorithm. This is the maximum number of 'units' the bucket can hold and also defines the maximum burst rate, assuming instantaneous usage of 'units'. In reality, the usage of 'units' takes times, and so it is possible for the bucket to incrementally refill while consuming from the bucket.

Definition at line 56 of file LeakyBucketControlParameters.cs.

◆ RefillAmount

int QuantConnect.Packets.LeakyBucketControlParameters.RefillAmount

Sets the refill amount of the bucket. This defines the quantity of 'units' that become available to a consuming entity after the time interval has elapsed. For example, if the refill amount is equal to one, then each time interval one new 'unit' will be made available for a consumer that is throttled by the leaky bucket.

Definition at line 65 of file LeakyBucketControlParameters.cs.

◆ TimeIntervalMinutes

int QuantConnect.Packets.LeakyBucketControlParameters.TimeIntervalMinutes

Sets the time interval for the refill amount of the bucket, in minutes. After this amount of wall-clock time has passed, the bucket will refill the refill amount, thereby making more 'units' available for a consumer. For example, if the refill amount equals 10 and the time interval is 30 minutes, then every 30 minutes, 10 more 'units' become available for a consumer. The available 'units' will continue to increase until the bucket capacity is reached.

Definition at line 75 of file LeakyBucketControlParameters.cs.


The documentation for this class was generated from the following file: