MetricRegistry metricRegistry = mWorker.getWorkerMetricsSystem().getMetricRegistry();
Map<String, Counter> counters = metricRegistry.getCounters();
String blocksCachedProperty = CommonUtils.argsToString(".",
WorkerContext.getWorkerSource().getName(), WorkerSource.BLOCKS_CACHED);
Gauge blocksCached = metricRegistry.getGauges().get(blocksCachedProperty);
<BUG>Map<String, Long> metrics = new HashMap<>(counters.size() + 1);
for (Map.Entry<String, Counter> counter : counters.entrySet()) {</BUG>
metrics.put(counter.getKey(), counter.getValue().getCount());
}
metrics.put(blocksCachedProperty, ((Integer) blocksCached.getValue()).longValue());

MetricRegistry metricRegistry = mWorker.getWorkerMetricsSystem().getMetricRegistry();
Map<String, Counter> counters = metricRegistry.getCounters();
String blocksCachedProperty = CommonUtils.argsToString(".",
WorkerContext.getWorkerSource().getName(), WorkerSource.BLOCKS_CACHED);
Gauge blocksCached = metricRegistry.getGauges().get(blocksCachedProperty);
SortedMap<String, Long> metrics = new TreeMap<>();
for (Map.Entry<String, Counter> counter : counters.entrySet()) {
metrics.put(counter.getKey(), counter.getValue().getCount());
}
metrics.put(blocksCachedProperty, ((Integer) blocksCached.getValue()).longValue());
