codahale/metrics — pull request #174 by martel (2012-02-29 12:34:54+00:00)
Title: Getter for metrics to ease unit testing

Getters to ease the pain of unit testing.

So instead of this:

```java
@Test
public void measuresGets() throws Exception {

cache.get("woo");

final Timer gets = Metrics.newTimer(Cache.class,
"get",
"test-config",
TimeUnit.MILLISECONDS,
TimeUnit.SECONDS);

assertThat(gets.count(), is(1L));

}
```

You could write this:

```java
@Test
public void measuresGets() throws Exception {

cache.get("woo");

Timer gets = Metrics.defaultRegistry().get(
new MetricName(Cache.class, "get", "test-config"), Timer.class
);

assertThat(gets.count(), is(1L));

}

```