public Duration delay(int attempt) {
        if (attempt < 1) throw new IllegalArgumentException("Attempt must be positive");
        double currentDelay = attempt * initialDelay.toMillis();
        double delta = RANDOMIZATION_FACTOR * currentDelay;
        double lowerDelay = currentDelay - delta;
        double upperDelay = currentDelay + delta;
        long millis = (long) Math.min(lowerDelay + (random.nextDouble() * (upperDelay - lowerDelay + 1)),
                                      maxDelay.toMillis());
        return Duration.ofMillis(millis);
    }
Return the delay of given attempt
vespajlib/src/main/java/com/yahoo/time/ExponentialBackoff.java