addthis/metrics-reporter-config — pull request #12 by mspiegel (2014-09-19 02:09:42+00:00)
Title: Initial implementation of metrics 3.x support.

This implementation has barely been tested with metrics 2.x or 3.x.
Specifically I have been able to run the CSV reporter with metrics
2.x or 3.x. We should probably do some additional testing before
merging to master.

I do not have a lot of experience with metrics 3.x. Based on the
pull request https://github.com/addthis/metrics-reporter-config/pull/6
and the Metrics 3.x Getting Started Guide
https://dropwizard.github.io/metrics/3.1.0/getting-started,
it looks like the application is responsible for creating a MetricRegistry object.

Since we used the default registry in the metrics 2.x implementation,
I created two parallel APIs. The old API has #enable() methods
that do not accept arguments. The new API has #enable(registry) methods
that accept a Metrics 3.x MetricRegistry object. I tried to reuse
as much code as possible in between the two APIs.

If we want to adopt an API that is more explicit about the version
of the metrics library, such as either passing in an enum parameter
with the metrics version, or changing the name of the method to
enable2() or something like that, I am fine with any of that.
The final API should probably be backwards compatible with the
existing #enable() methods.

There are three FIXME statements. They do not break this implementation
but they are worth addressing.