@Test
  public void testScannerMetrics() {
    HELPER.assertCounter("scannerLeaseExpiredCount", 0, serverSource);
    rsm.incrScannerLeaseExpired();
    HELPER.assertCounter("scannerLeaseExpiredCount", 1, serverSource);
    HELPER.assertGauge("activeScanners", 0, serverSource);
  }
Unit test version of rs metrics tests.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServer.java