@Test
  public void testTimedAverageMetricsReal() {
    TimedAverageMetrics metrics =
        new TimedAverageMetrics(10, 6 * 1000 * 1000);

    for (int i = 0; i < 50; i++) {
      metrics.add(100);
      try {
        Thread.sleep(10);
      } catch (InterruptedException ie) {
        Thread.currentThread().interrupt();
      }
    }
    assertEquals("Checking the calculated value", 100, metrics.value());
  }
Test the real interfaces of the TimedAverageMetrics.
llap-server/src/test/org/apache/hadoop/hive/llap/metrics/TestLlapDaemonExecutorMetrics.java