private void updateMetrics(RestRequestMetricsTracker restRequestMetricsTracker, boolean induceFailure)
      throws InterruptedException {
    restRequestMetricsTracker.nioMetricsTracker.addToRequestProcessingTime(nioLayerRequestProcessingTime);
    restRequestMetricsTracker.nioMetricsTracker.addToResponseProcessingTime(nioLayerResponseProcessingTime);

    restRequestMetricsTracker.nioMetricsTracker.markRequestReceived();
    Thread.sleep(REQUEST_SLEEP_TIME_MS);
    restRequestMetricsTracker.nioMetricsTracker.markFirstByteSent();
    Thread.sleep(REQUEST_SLEEP_TIME_MS);
    restRequestMetricsTracker.nioMetricsTracker.markRequestCompleted();

    restRequestMetricsTracker.scalingMetricsTracker.addToRequestProcessingTime(scRequestProcessingTime);
    restRequestMetricsTracker.scalingMetricsTracker.addToResponseProcessingTime(scResponseProcessingTime);
    restRequestMetricsTracker.scalingMetricsTracker.addToRequestProcessingWaitTime(scRequestProcessingWaitTime);
    restRequestMetricsTracker.scalingMetricsTracker.addToResponseProcessingWaitTime(scResponseProcessingWaitTime);

    restRequestMetricsTracker.setBytesTransferred(bytesTransferred);

    if (induceFailure) {
      restRequestMetricsTracker.markFailure();
    }
  }
Updates the generated metrics in the given {@code restRequestMetricsTracker}.
@param restRequestMetricsTracker the instance of {@link RestRequestMetricsTracker} where metrics have to be
                                 updated.
@param induceFailure if {@code true}, the request is marked as failed.
ambry-api/src/test/java/com/github/ambry/rest/RestRequestMetricsTrackerTest.java