/** * Logs overall transfer rate for an S3 file transfer operation. * * @param s3FileTransferResultsDto the DTO for the S3 file transfer operation results */ private void logOverallTransferRate(S3FileTransferResultsDto s3FileTransferResultsDto) { if (LOGGER.isInfoEnabled()) { NumberFormat formatter = new DecimalFormat("#0.00"); LOGGER.info("overallTransferRateKiloBytesPerSecond={} overallTransferRateMegaBitsPerSecond={}", formatter.format(awsHelper .getTransferRateInKilobytesPerSecond(s3FileTransferResultsDto.getTotalBytesTransferred(), s3FileTransferResultsDto.getDurationMillis())), formatter.format(awsHelper .getTransferRateInMegabitsPerSecond(s3FileTransferResultsDto.getTotalBytesTransferred(), s3FileTransferResultsDto.getDurationMillis()))); } }
/** * Logs overall transfer rate for an S3 file transfer operation. * * @param s3FileTransferResultsDto the DTO for the S3 file transfer operation results */ private void logOverallTransferRate(S3FileTransferResultsDto s3FileTransferResultsDto) { if (LOGGER.isInfoEnabled()) { NumberFormat formatter = new DecimalFormat("#0.00"); LOGGER.info("overallTransferRateKiloBytesPerSecond={} overallTransferRateMegaBitsPerSecond={}", formatter.format(awsHelper .getTransferRateInKilobytesPerSecond(s3FileTransferResultsDto.getTotalBytesTransferred(), s3FileTransferResultsDto.getDurationMillis())), formatter.format(awsHelper .getTransferRateInMegabitsPerSecond(s3FileTransferResultsDto.getTotalBytesTransferred(), s3FileTransferResultsDto.getDurationMillis()))); } }
@Test public void testGetTransferRateInKilobytesPerSecond() { assertEquals(Double.valueOf(0.1), awsHelper.getTransferRateInKilobytesPerSecond(10L, 100L)); }