codahale/metrics — pull request #107 by chids (2011-11-16 10:42:03+00:00)
Title: Enable customized metric names when using annotations (previously issue #46)

This commit adds the following:

### Ability to customize naming of metrics
``MetricsRegistry.createName()`` can be overridden to customize how metrics are named when they are created.

### Ability to provide the instances of registries used with Guice
Adding overridable methods ``createHealthCheckRegistry()`` and ``createMetricsRegistry()`` to ``InstrumentationModule`` in metrics-guice it's possible to provide specify custom instances of both ``MetricsRegistry`` and ``HealthCheckRegistry`` that'll be bound by Guice.

----
#### Usage
When using Metrics with Guice and requiring customized naming of metrics one would subclass ``InstrumentationModule`` and have ``createMetricsRegistry()`` return a ``MetricsRegistry`` where createName() is overridden to do whatever magic is requried.

#### Example case
We use this to append the servlet context to metric names in order to prevent collisions when deploying multiple versions of the same service beneath different contexts (in Tomcat).