private void registerCustomPercentiles(Class ownerClass, String name, Histogram histogram, List<Double> percentiles) {
    percentiles.forEach(p -> {
      Gauge<Double> customPercentile = () -> histogram.getSnapshot().getValue(p);
      metricRegistry.register(MetricRegistry.name(ownerClass, name, String.valueOf(p * 100), "thPercentile"),
          customPercentile);
    });
  }
Register {@link Gauge} metric for each custom percentile of given {@link Histogram} with given class and name.
@param ownerClass the {@link Class} that is supposed to own the metrics.
@param name the name of metric that all percentiles belong to.
@param histogram the {@link Histogram} to use.
@param percentiles a list of interested percentiles (double value).
ambry-router/src/main/java/com/github/ambry/router/NonBlockingRouterMetrics.java