static CachedHistogram createHistogram(RouterConfig routerConfig, boolean useDefaultReservoirParams) {
    Reservoir reservoir;
    long cacheTimeoutMs;
    double quantile;
    if (routerConfig != null) {
      if (useDefaultReservoirParams) {
        reservoir = new ExponentiallyDecayingReservoir();
      } else {
        reservoir = new ExponentiallyDecayingReservoir(routerConfig.routerOperationTrackerReservoirSize,
            routerConfig.routerOperationTrackerReservoirDecayFactor);
      }
      cacheTimeoutMs = routerConfig.routerOperationTrackerHistogramCacheTimeoutMs;
      quantile = routerConfig.routerLatencyToleranceQuantile;
    } else {
      reservoir = new ExponentiallyDecayingReservoir();
      cacheTimeoutMs = RouterConfig.DEFAULT_OPERATION_TRACKER_HISTOGRAM_CACHE_TIMEOUT_MS;
      quantile = RouterConfig.DEFAULT_LATENCY_TOLERANCE_QUANTILE;
    }
    return new CachedHistogram(reservoir, cacheTimeoutMs, quantile);
  }
Create a histogram with parameters specified by the provided {@link RouterConfig} that stores cached values for use
by {@link OperationTracker}.
@param routerConfig the {@link RouterConfig} containing the histogram parameters.
@param useDefaultReservoirParams {@code true} to use the default {@link ExponentiallyDecayingReservoir} constructor
                                 instead of the parameters from the config.
@return a configured {@link CachedHistogram}.
ambry-router/src/main/java/com/github/ambry/router/NonBlockingRouterMetrics.java