public static void addTransferRateMetric(final DataNodeMetrics metrics, final long read,
      final long durationInNS) {
    metrics.addReadTransferRate(getTransferRateInBytesPerSecond(read, durationInNS));
  }
@Test
  public void testAddTransferRateMetricForValidValues() {
    DataNodeMetrics mockMetrics = mock(DataNodeMetrics.class);
    DFSUtil.addTransferRateMetric(mockMetrics, 3_251_854_872L, 129_593_000_000L);
    verify(mockMetrics).addReadTransferRate(250_92_828L);
  }