Map<Resource, CachedHistogram> getResourceToLatencyMap(RouterOperation routerOperation, boolean isLocal) {
    Map<Resource, CachedHistogram> resourceToHistogramMap;
    switch (routerOperation) {
      case GetBlobInfoOperation:
        resourceToHistogramMap = isLocal ? routerMetrics.getBlobInfoLocalDcResourceToLatency
            : routerMetrics.getBlobInfoCrossDcResourceToLatency;
        break;
      case GetBlobOperation:
        resourceToHistogramMap =
            isLocal ? routerMetrics.getBlobLocalDcResourceToLatency : routerMetrics.getBlobCrossDcResourceToLatency;
        break;
      case PutOperation:
        resourceToHistogramMap = routerMetrics.putBlobResourceToLatency;
        break;
      default:
        throw new IllegalArgumentException("Unsupported router operation when getting resource-to-latency map");
    }
    return resourceToHistogramMap;
  }
Get certain resource-level histograms based on given arguments.
@param routerOperation the {@link RouterOperation} that uses this tracker.
@param isLocal {@code true} if local resource-level histograms should be returned. {@code false} otherwise.
@return resource-to-histogram map.
ambry-router/src/main/java/com/github/ambry/router/AdaptiveOperationTracker.java