@Test
  public void testFailureNoScheduledId() throws Exception {
    MetricCollector.getInstance().deinit();
    conf = new HiveConf();
    MetricCollector.getInstance().init(conf);
    ReplicationMetricCollector bootstrapDumpMetricCollector = new BootstrapDumpMetricCollector("db",
        "dummyDir", conf, 0L);
    Map<String, Long> metricMap = new HashMap<>();
    metricMap.put(ReplUtils.MetricName.TABLES.name(), (long) 10);
    metricMap.put(ReplUtils.MetricName.FUNCTIONS.name(), (long) 1);
    bootstrapDumpMetricCollector.reportStageStart("dump", metricMap);
    bootstrapDumpMetricCollector.reportStageEnd("dump", Status.SUCCESS);
    Assert.assertEquals(0, MetricCollector.getInstance().getMetrics().size());
  }
Unit Test class for In Memory Replication Metric Collection.
ql/src/test/org/apache/hadoop/hive/ql/parse/repl/metric/TestReplicationMetricCollector.java