dropwizard/metrics — pull request #680 by julio-lopez (2014-10-07 06:09:07+00:00)
Title: Allow specifying a default reservoir for a registry.

Motivation:

A usage pattern for the metrics library is to create a MetricRegistry
and use the counter(), histogram(), meter() and timer() methods to
create metrics for the application. When these methods are called
MetricRegistry potentially creates new metrics with their default
parameters.

Creating metrics with non-default parameters, in particular a
non-default reservoir, currently requires explicitly creating the
metric and then registering it and remembering it for future use.
This prevents leveraging functionality already provided by
MetricsRegistry.

Proposed approach:
Allow specifying a ReservoirBuilder at MetricsRegistry creation
time. ReservoirBuilder creates new reservoirs with custom
parameters. This allows the creation of histograms and timers
with custom default reservoirs.

Alternate approaches:
A potentially more comprehensive approach would be to allow
passing a custom "MetricsBuilder" to the MetricsRegistry
constructor. This approach is definitely worth exploring.

Closes #679