if (scope != null) {
name = MetricRegistry.name(name, scope);
}
MetricRegistry reg = Metrics.getRegistry();
hitCount = reg.register(MetricRegistry.name(name, "Hit Count"),
new JmxAttributeGauge(nameObj, "HitCount"));
hitRate = reg.register(MetricRegistry.name(name, "Hit Rate"),
new JmxAttributeGauge(nameObj, "HitRate"));
loadCount = reg.register(MetricRegistry.name(name, "Load Count"),
new JmxAttributeGauge(nameObj, "LoadCount"));
missRate = reg.register(MetricRegistry.name(name, "Miss Rate"),
new JmxAttributeGauge(nameObj, "MissRate"));
requestCount = reg.register(MetricRegistry.name(name, "Request Count"),
new JmxAttributeGauge(nameObj, "RequestCount"));
totalLoadTime = reg.register(MetricRegistry.name(name, "Total Load Time"),
new JmxAttributeGauge(nameObj, "TotalLoadTime"));
}