src/main/java/com/linecorp/armeria/server/metrics/MetricCollectingService.java
/**
     * A {@link Service} decorator that tracks request stats using the Dropwizard metrics library.
     * To use, simply prepare a {@link MetricRegistry} and add this decorator to a service specification.
     *
     * @param metricRegistry the {@link MetricRegistry} to store metrics into.
     * @param metricNamePrefix the prefix of the names of the metrics created by the returned decorator.
     *
     * <p>Example:
     * <pre>{@code
     * MetricRegistry metricRegistry = new MetricRegistry();
     * serverBuilder.serviceAt(
     *         "/service",
     *         ThriftService.of(handler).decorate(
     *                 MetricCollectingService.newDropwizardDecorator(
     *                         metricRegistry, MetricRegister.name("services", "myService"))));
     * }
     * </pre>
     * <p>It is generally recommended to define your own name for the service instead of using something like
     * the Java class to make sure otherwise safe changes like renames don't break metrics.
     */
A  Service decorator that tracks request stats using the Dropwizard metrics library.
To use, simply prepare a  MetricRegistry and add this decorator to a service specification.

@param metricRegistry the  MetricRegistry to store metrics into.
@param metricNamePrefix the prefix of the names of the metrics created by the returned decorator.


A Service decorator that tracks request stats using the Dropwizard metrics library . To use simply prepare a MetricRegistry and add this decorator to a service specification . @param metricRegistry the MetricRegistry to store metrics into . @param metricNamePrefix the prefix of the names of the metrics created by the returned decorator .
public static Function<Service, Service> newDropwizardDecorator(MetricRegistry metricRegistry,
                                                                    String metricNamePrefix) {
        return service -> new MetricCollectingService(
                service,
                new DropwizardMetricConsumer(metricRegistry, metricNamePrefix));
    }
public static Function < Service , Service > newDropwizardDecorator ( MetricRegistry metricRegistry , String metricNamePrefix ) { return service -> new MetricCollectingService ( service , new DropwizardMetricConsumer ( metricRegistry , metricNamePrefix ) ) ; }
A {@link Service} decorator that tracks request stats using the Dropwizard metrics library.
A { @link Service } decorator that tracks request stats using the Dropwizard metrics library .