public static void addTransferRateMetric(final DataNodeMetrics metrics, final long read,
      final long durationInNS) {
    metrics.addReadTransferRate(getTransferRateInBytesPerSecond(read, durationInNS));
  }
@Test
  public void testAddTransferRateMetricZeroTransferBytes() {
    DataNodeMetrics mockMetrics = mock(DataNodeMetrics.class);
    DFSUtil.addTransferRateMetric(mockMetrics, -1L, 0);
    verify(mockMetrics).addReadTransferRate(0L);
  }