@Override
    public void onResponseComplete(Exception exception) {
      if (responseComplete.compareAndSet(false, true)) {
        try {
          if (exception != null) {
            logger.error("Request handling encountered exception", exception);
            restRequest.getMetricsTracker().markFailure();
            perfNioServerMetrics.requestResponseError.inc();
          }
          restRequest.close();
          long requestRoundTripTime = System.currentTimeMillis() - startTime;
          logger.debug("Request took {} ms. {} bytes were written into the channel", requestRoundTripTime,
              noOpAWC.getBytesConsumedTillNow());
          perfNioServerMetrics.requestRoundTripTimeInMs.update(requestRoundTripTime);
          if (callback != null) {
            callback.onCompletion(null, exception);
          }
        } catch (IOException e) {
          logger.error("Exception during onResponseComplete", e);
        }
      }
    }
Creates a new instance of NoOpRestResponseChannel.
@param restRequest the {@link RestRequest} for which a response will be sent over this channel.
@param perfNioServerMetrics the {@link PerfNioServerMetrics} instance to use to record metrics.
@param callback the {@link Callback} that will be invoked on {@link #onResponseComplete(Exception)} or
{@link #close()}.
ambry-tools/src/main/java/com/github/ambry/tools/perf/rest/PerfNioServer.java