* @param jsonMetric A JSONMetric to make a Metric from
* @return A Metric equivalent to the given JSONMetric
*/
protected Metric createMetric(JSONMetric jsonMetric) {
// Split the name from the JSON on dots for the metric group/type/name
MetricName metricName;
ArrayList<String> parts = new ArrayList<String>(Arrays.asList(jsonMetric.getName().split("\\.")));
if (parts.size() >= 3)
metricName = new MetricName(parts.remove(0), parts.remove(0), StringUtils.join(parts, "."));
else
metricName = new MetricName(jsonMetric.getName(), "", "");
Class<?> metricType = jsonMetric.getMetricClass();
if (metricType == Gauge.class) {
return Metrics.newGauge(metricName, new GaugeMetricImpl());
} else if (metricType == Counter.class) {