public String getStatus() throws Exception {
    MetricsSource source =
      DefaultMetricsSystem.instance().getSource(MetricsBalancerSource.METRICS_JMX_CONTEXT);
    if (source instanceof MetricsBalancerSourceImpl) {
      MetricsTag status = ((MetricsBalancerSourceImpl) source).getMetricsRegistry()
        .getTag(MetricsBalancerSource.BALANCER_STATUS);
      return status.value();
    } else {
      LOG.warn("Balancer JMX Metrics not registered");
      throw new Exception("MetricsBalancer JMX Context not found");
    }
  }
Gets the balancer status tag from the Metrics registry
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestBalancerStatusTagInJMXMetrics.java