class PeerReputation {

  public Optional<DisconnectReason> recordRequestTimeout(final int requestCode) {
    final int newTimeoutCount = getOrCreateTimeoutCount(requestCode).incrementAndGet();
    if (newTimeoutCount >= TIMEOUT_THRESHOLD) {
      LOG.debug("Disconnection triggered by repeated timeouts");
      return Optional.of(DisconnectReason.TIMEOUT);
    } else {
      return Optional.empty();
    }
  }

}