@org.junit.Ignore("HIVE-26262")
  @Test
  public void testReplStatsInMetrics() throws HiveException, InterruptedException, TException {
    int origRMProgress = ReplStatsTracker.RM_PROGRESS_LENGTH;
    ReplStatsTracker.RM_PROGRESS_LENGTH = 10;
    ReplicationMetricCollector incrementDumpMetricCollector =
        new IncrementalDumpMetricCollector("testAcidTablesReplLoadBootstrapIncr_1592205875387",
            "hdfs://localhost:65158/tmp/org_apache_hadoop_hive_ql_parse_TestReplicationScenarios_245261428230295"
                + "/hrepl0/dGVzdGFjaWR0YWJsZXNyZXBsbG9hZGJvb3RzdHJhcGluY3JfMTU5MjIwNTg3NTM4Nw==/0/hive", conf, 0L);
    Map<String, Long> metricMap = new HashMap<>();
    ReplStatsTracker repl = Mockito.mock(ReplStatsTracker.class);

    Mockito.when(repl.toString()).thenReturn(RandomStringUtils.randomAlphabetic(1000));
    metricMap.put(ReplUtils.MetricName.EVENTS.name(), (long) 10);
    incrementDumpMetricCollector.reportStageStart("dump", metricMap);
    incrementDumpMetricCollector.reportStageProgress("dump", ReplUtils.MetricName.EVENTS.name(), 10);
    incrementDumpMetricCollector
        .reportStageEnd("dump", Status.SUCCESS, 10, new SnapshotUtils.ReplSnapshotCount(), repl);
    Thread.sleep(1000 * 20);
    GetReplicationMetricsRequest metricsRequest = new GetReplicationMetricsRequest();
    metricsRequest.setPolicy("repl");
    ReplicationMetricList actualReplicationMetrics = Hive.get(conf).getMSC().getReplicationMetrics(metricsRequest);
    String progress = deSerialize(actualReplicationMetrics.getReplicationMetricList().get(0).getProgress());
    assertTrue(progress, progress.contains("ERROR: RM_PROGRESS LIMIT EXCEEDED."));
    ReplStatsTracker.RM_PROGRESS_LENGTH = origRMProgress;

    //Testing K_MAX
    repl = new ReplStatsTracker(15);
    Assert.assertEquals(ReplStatsTracker.TOP_K_MAX, repl.getK());
  }
Unit Test class for In Memory Replication Metric Collection.
ql/src/test/org/apache/hadoop/hive/ql/parse/repl/metric/TestReplicationMetricSink.java