Interface GradientCapacityLimiterBuilder.Observer
- Enclosing class:
- GradientCapacityLimiterBuilder
public static interface GradientCapacityLimiterBuilder.Observer
A state observer for Gradient
CapacityLimiter to monitor internal state changes.
Note: callbacks are not guaranteed to be executed sequentially or in exactly the same order that state changes
occurred.-
Method Summary
Modifier and TypeMethodDescriptionvoidCallback that informs when the active requests decreased by 1.voidCallback that informs when the active requests increased by 1.voidonLimitChange(double longRtt, double shortRtt, double gradient, double oldLimit, double newLimit) A limit observer callback, to consume the trigger state of thisCapacityLimiterwhen a limit change happens.
-
Method Details
-
onActiveRequestsIncr
void onActiveRequestsIncr()Callback that informs when the active requests increased by 1. -
onActiveRequestsDecr
void onActiveRequestsDecr()Callback that informs when the active requests decreased by 1. -
onLimitChange
void onLimitChange(double longRtt, double shortRtt, double gradient, double oldLimit, double newLimit) A limit observer callback, to consume the trigger state of thisCapacityLimiterwhen a limit change happens. Useful to monitor the limit changes and their triggers.The rate of reporting to the observer is based on the rate of change to this
CapacityLimiterand thesampling interval.- Parameters:
longRtt- The exponential moving average stat of request response times. A negative value means response times were not used in the calculation.shortRtt- The sampled response time that triggered the limit change. A negative value means * response times were not used in the calculation.gradient- The response time gradient (delta) between the long exposed stat (see. longRtt) and the sampled response time (see. shortRtt). A negative value means the gradient was not used in the calculation.oldLimit- The previous limit of the limiter.newLimit- The current limit of the limiter.
-