public void snapshotAllMetrics(MetricRegistry metricRegistry, MetricsCollector collector) {
    MetricRegistryInfo info = metricRegistry.getMetricRegistryInfo();
    MetricsRecordBuilder builder =
      collector.addRecord(Interns.info(info.getMetricsName(), info.getMetricsDescription()));
    builder.setContext(info.getMetricsContext());

    snapshotAllMetrics(metricRegistry, builder);
  }
Iterates over the MetricRegistry and adds them to the {@code collector}.
@param collector A metrics collector
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java