@Override
  public String toDebugString(BaseSource source) {
    getMetrics(source);
    StringBuilder sb = new StringBuilder();
    sb.append("Tags=").append(tags).append(", Counters=").append(counters);
    return sb.append(", Gauges=").append(gauges).toString();
  }
A helper class that will allow tests to get into hadoop2's metrics2 values.
hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelperImpl.java