public static Timer newTimer(MeterRegistry registry, String name, Iterable<Tag> tags,
                                 DistributionStatisticConfig distStatsConfig) {
        requireNonNull(registry, "registry");
        requireNonNull(name, "name");
        requireNonNull(tags, "tags");
        requireNonNull(distStatsConfig, "distStatsConfig");

        final Double maxExpectedValueNanos = distStatsConfig.getMaximumExpectedValueAsDouble();
        final Double minExpectedValueNanos = distStatsConfig.getMinimumExpectedValueAsDouble();
        final Duration maxExpectedValue =
                maxExpectedValueNanos != null ? Duration.ofNanos(maxExpectedValueNanos.longValue()) : null;
        final Duration minExpectedValue =
                minExpectedValueNanos != null ? Duration.ofNanos(minExpectedValueNanos.longValue()) : null;

        final double[] sloBoundariesNanos = distStatsConfig.getServiceLevelObjectiveBoundaries();
        final Duration[] sloBoundaries =
                sloBoundariesNanos != null ? Arrays.stream(sloBoundariesNanos)
                                                   .mapToObj(slo -> Duration.ofNanos((long) slo))
                                                   .toArray(Duration[]::new)
                                           : null;

        return Timer.builder(name)
                    .tags(tags)
                    .maximumExpectedValue(maxExpectedValue)
                    .minimumExpectedValue(minExpectedValue)
                    .publishPercentiles(distStatsConfig.getPercentiles())
                    .publishPercentileHistogram(distStatsConfig.isPercentileHistogram())
                    .percentilePrecision(distStatsConfig.getPercentilePrecision())
                    .distributionStatisticBufferLength(distStatsConfig.getBufferLength())
                    .distributionStatisticExpiry(distStatsConfig.getExpiry())
                    .serviceLevelObjectives(sloBoundaries)
                    .register(registry);
    }
Returns a newly-registered {@link Timer} configured by given {@link DistributionStatisticConfig}.

@param distStatsConfig the {@link DistributionStatisticConfig} to use
core/src/main/java/com/linecorp/armeria/common/metric/MoreMeters.java