Package com.yahoo.vespa.http.client.core
Class ThrottlePolicy
- java.lang.Object
-
- com.yahoo.vespa.http.client.core.ThrottlePolicy
-
public class ThrottlePolicy extends Object
Class that has a method for finding next maxInFlight.- Author:
- dybis
-
-
Field Summary
Fields Modifier and Type Field Description static double
SMALL_DIFFERENCE_IN_SUCCESSES_RATIO
-
Constructor Summary
Constructors Constructor Description ThrottlePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
calcNewMaxInFlight(double maxPerformanceChange, int numOk, int previousNumOk, int previousMaxInFlight, int maxInFlightNow, boolean messagesQueued)
Generate nex in-flight value for throttling.
-
-
-
Field Detail
-
SMALL_DIFFERENCE_IN_SUCCESSES_RATIO
public static final double SMALL_DIFFERENCE_IN_SUCCESSES_RATIO
- See Also:
- Constant Field Values
-
-
Method Detail
-
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).
-
-