public static class GradientLimit.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
GradientLimit.Builder |
backoffRatio(double backoffRatio)
Ratio applied to the limit when a timeout was identified within the sampling window.
|
GradientLimit |
build() |
GradientLimit.Builder |
initialLimit(int initialLimit)
Initial limit used by the limiter
|
GradientLimit.Builder |
maxConcurrency(int maxConcurrency)
Maximum allowable concurrency.
|
GradientLimit.Builder |
metricRegistry(MetricRegistry registry)
Registry for reporting metrics about the limiter's internal state.
|
GradientLimit.Builder |
minLimit(int minLimit)
Minimum concurrency limit allowed.
|
GradientLimit.Builder |
minRttThreshold(long minRttThreshold,
java.util.concurrent.TimeUnit units)
Deprecated.
|
GradientLimit.Builder |
probeInterval(int probeInterval)
The limiter will probe for a new noload RTT every probeInterval
updates.
|
GradientLimit.Builder |
probeMultiplier(int probeMultiplier)
Deprecated.
|
GradientLimit.Builder |
queueSize(java.util.function.Function<java.lang.Integer,java.lang.Integer> queueSize)
Function to dynamically determine the amount the estimated limit can grow while
latencies remain low as a function of the current limit.
|
GradientLimit.Builder |
queueSize(int queueSize)
Fixed amount the estimated limit can grow while latencies remain low
|
GradientLimit.Builder |
rttTolerance(double rttTolerance)
Tolerance for changes in minimum latency.
|
GradientLimit.Builder |
smoothing(double smoothing)
Smoothing factor to limit how aggressively the estimated limit can shrink
when queuing has been detected.
|
@Deprecated public GradientLimit.Builder minRttThreshold(long minRttThreshold, java.util.concurrent.TimeUnit units)
minRttThreshold
- units
- public GradientLimit.Builder initialLimit(int initialLimit)
initialLimit
- public GradientLimit.Builder minLimit(int minLimit)
minLimit
- public GradientLimit.Builder rttTolerance(double rttTolerance)
rttTolerance
- Value >= 1.0 indicating how much change in minimum latency is acceptable
before reducing the limit. For example, a value of 2.0 means that a 2x increase in latency is acceptable.public GradientLimit.Builder maxConcurrency(int maxConcurrency)
maxConcurrency
- public GradientLimit.Builder queueSize(int queueSize)
queueSize
- public GradientLimit.Builder queueSize(java.util.function.Function<java.lang.Integer,java.lang.Integer> queueSize)
queueSize
- public GradientLimit.Builder smoothing(double smoothing)
smoothing
- Value of 0.0 to 1.0 where 1.0 means the limit is completely
replicated by the new estimate.public GradientLimit.Builder metricRegistry(MetricRegistry registry)
registry
- public GradientLimit.Builder backoffRatio(double backoffRatio)
backoffRatio
- @Deprecated public GradientLimit.Builder probeMultiplier(int probeMultiplier)
public GradientLimit.Builder probeInterval(int probeInterval)
probeInterval
- public GradientLimit build()