class CodaHaleMetricRegistry implements MetricRegistry {

    @Override
    public Timer timer(String name) {
        Map<String, Metric> metrics = metricRegistry.getMetrics();

        Metric metric = metrics.get(name);

        if (metric instanceof Timer) {
            return (Timer) metric;
        }

        if (metric == null) {
            try {
                return register(name, newTimer());
            } catch (IllegalArgumentException e) {
                Metric added = metrics.get(name);
                if (added instanceof Timer) {
                    return (Timer) added;
                }
            }
        }
        throw new IllegalArgumentException(name + " is already used for a different type of metric");
    }

    public  CodaHaleMetricRegistry(com.codahale.metrics.MetricRegistry metricRegistry);
    public  CodaHaleMetricRegistry();

}