@Test
  public void testTimedAverageMetricsDataBound() {
    TimedAverageMetrics metrics;

    // Window 1
    metrics = generateTimedAverageMetrics(1, 100, 1, 100, 0, 50, 1);
    assertEquals("Window size 1", 100, metrics.value(100));

    // Overflow at the bottom
    metrics = generateTimedAverageMetrics(3, 100, 4, 50, 10, 50, 10);
    assertEquals("Window size 1 with multiple data", 65, metrics.value(100));

  }
Test generated values for TimedAverageMetrics when we have less data points than the window.
llap-server/src/test/org/apache/hadoop/hive/llap/metrics/TestLlapDaemonExecutorMetrics.java