@Test void lowBoundNormal() { double factor = 0.5; Duration min = Duration.ofMillis(100); Duration max = Duration.ofMillis(-123); Duration delay = Duration.ofMillis(500); BackoffDelay bd = new BackoffDelay(min, max, delay); RandomJitter jitter = new RandomJitter(factor); assertThat(jitter.lowJitterBound(bd, 250)) .isEqualTo(-250); }
long lowJitterBound(BackoffDelay backoff, long jitterOffset) { return Math.max( backoff.min.minus(backoff.delay).toMillis(), -jitterOffset); }
RandomJitter implements Jitter { long lowJitterBound(BackoffDelay backoff, long jitterOffset) { return Math.max( backoff.min.minus(backoff.delay).toMillis(), -jitterOffset); } }
RandomJitter implements Jitter { long lowJitterBound(BackoffDelay backoff, long jitterOffset) { return Math.max( backoff.min.minus(backoff.delay).toMillis(), -jitterOffset); } RandomJitter(double randomFactor); }
RandomJitter implements Jitter { long lowJitterBound(BackoffDelay backoff, long jitterOffset) { return Math.max( backoff.min.minus(backoff.delay).toMillis(), -jitterOffset); } RandomJitter(double randomFactor); @Override Duration apply(BackoffDelay backoff); @Override String toString(); }
RandomJitter implements Jitter { long lowJitterBound(BackoffDelay backoff, long jitterOffset) { return Math.max( backoff.min.minus(backoff.delay).toMillis(), -jitterOffset); } RandomJitter(double randomFactor); @Override Duration apply(BackoffDelay backoff); @Override String toString();  }