@Override
  public void onResponse(ReplicaId replicaId, TrackedRequestFinalState trackedRequestFinalState) {
    super.onResponse(replicaId, trackedRequestFinalState);
    long elapsedTime;
    if (unexpiredRequestSendTimes.containsKey(replicaId)) {
      elapsedTime = time.milliseconds() - unexpiredRequestSendTimes.remove(replicaId).getSecond();
    } else {
      elapsedTime = time.milliseconds() - expiredRequestSendTimes.remove(replicaId);
    }
    if (trackedRequestFinalState != TrackedRequestFinalState.TIMED_OUT
        || !routerConfig.routerOperationTrackerExcludeTimeoutEnabled) {
      getLatencyHistogram(replicaId).update(elapsedTime);
      if (routerConfig.routerOperationTrackerMetricScope != OperationTrackerScope.Datacenter) {
        // This is only used to report whole datacenter histogram for monitoring purpose
        Histogram histogram = replicaId.getDataNodeId().getDatacenterName().equals(datacenterName) ? localDcHistogram
            : crossDcHistogram;
        histogram.update(elapsedTime);
      }
    }
  }
Constructs an {@link AdaptiveOperationTracker}
@param routerConfig The {@link RouterConfig} containing the configs for operation tracker.
@param routerMetrics The {@link NonBlockingRouterMetrics} that contains histograms used by this operation tracker.
@param routerOperation The {@link RouterOperation} which {@link AdaptiveOperationTracker} is associated with.
@param partitionId The partition on which the operation is performed.
@param originatingDcName name of originating DC whose replicas should be tried first.
@param blobId {@link BlobId}, if available, for the operation.
@param time the {@link Time} instance to use.
ambry-router/src/main/java/com/github/ambry/router/AdaptiveOperationTracker.java