protected static int getTotalAttempts(ClientRequestContext ctx) {
        final State state = ctx.attr(STATE);
        if (state == null) {
            return 0;
        }
        return state.totalAttemptNo;
    }
Returns the total number of attempts of the current request represented by the specified
{@link ClientRequestContext}.
core/src/main/java/com/linecorp/armeria/client/retry/AbstractRetryingClient.java