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 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 phase
      previousNumOk - 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).