An immutable RetryBudget that never has a balance, and as such, will never allow a retry.
An immutable RetryBudget that always has a balance of 100
,
and as such, will always allow a retry.
Creates a RetryBudget that allows for about percentCanRetry
percent
of the total requests to be retried.
Creates a RetryBudget that allows for about percentCanRetry
percent
of the total requests to be retried.
Deposits created by deposit()
expire after
approximately ttl
time has passed. Must be >= 1 second
and <= 60 seconds
.
the minimum rate of retries allowed in order to
accommodate clients that have just started issuing requests as well as clients
that do not issue many requests per window.
Must be non-negative and if 0
, then no reserve is given.
the percentage of calls to deposit()
that can be
retried. This is in addition to any retries allowed for via minRetriesPerSec
.
Must be >= 0 and <= 1000. As an example, if 0.1
is used, then for every
10 calls to deposit()
, 1 retry will be allowed. If 2.0
is used then every
deposit
allows for 2 retries.
the current time in milliseconds since the epoch. The default of Stopwatch.systemMillis is generally appropriate, though using Stopwatch.timeMillis is useful for well behaved tests so that you can control com.twitter.util.Time.
Creates a default RetryBudget that allows for about 20% of the total requests to be retried on top of a minimum number per second in order to accommodate clients that have just started issuing requests or clients that have a low rate of requests per second.
Creates a default RetryBudget that allows for about 20% of the total requests to be retried on top of a minimum number per second in order to accommodate clients that have just started issuing requests or clients that have a low rate of requests per second.
Deposits created by deposit()
expire after some amount of time.
There is also a minimum reserve of retries allowed per time period
in order to accommodate clients that have just started issuing
requests as well as clients that do not issue many requests per window.
See RetryBudgets for Java APIs.