class RateLimit::Bucket
Bucket
tracks the credits for each item. Each bucket has the following parameters:
-
Args :
-
name
-> the name of the item that you allocated the bucket for -
current
-> the current credit limit (which may be larger than max, or more negative than min) -
max
-> the maximum that the bucket will be filled by the regeneration process -
min
-> the minimum that a bucket can go, must be <= 0. -
refill_amount
-> the amount that will be added to the bucket every refill_epoch seconds. -
refill_epoch
-> the number of seconds before the bucket is credited by the regeneration process -
last_refill
-> the timestamp of the last refill -
total_used
-> the total, cumulative credits used for service (so refusals don’t count)
-
-
Returns :
-
a
Bucket
-