Package com.yahoo.vespa.http.client.core
Class ThrottlePolicy
java.lang.Object
com.yahoo.vespa.http.client.core.ThrottlePolicy
Class that has a method for finding next maxInFlight.
- Author:
- dybis
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
calcNewMaxInFlight
(double maxPerformanceChange, int numOk, int previousNumOk, int previousMaxInFlight, int maxInFlightNow, boolean messagesQueued) Generate nex in-flight value for throttling.
-
Field Details
-
SMALL_DIFFERENCE_IN_SUCCESSES_RATIO
public static final double SMALL_DIFFERENCE_IN_SUCCESSES_RATIO- See Also:
-
-
Constructor Details
-
ThrottlePolicy
public ThrottlePolicy()
-
-
Method Details
-
calcNewMaxInFlight
public int calcNewMaxInFlight(double maxPerformanceChange, int numOk, int previousNumOk, int previousMaxInFlight, int maxInFlightNow, boolean messagesQueued) Generate nex in-flight value for throttling.- Parameters:
maxPerformanceChange
- This value limit the dynamics of the algorithm.numOk
- number of success in last phasepreviousNumOk
- number of success in previous (before last) phase.previousMaxInFlight
- number of max-in-flight in previous (before last) phase.maxInFlightNow
- number of max-in-flight in last phase.messagesQueued
- if any messages where queued.- Returns:
- The new value to be used for max-in-flight (should be cropped externally to fit max/min values).
-