mkuchenbecker commented on code in PR #5397:
URL: https://github.com/apache/hadoop/pull/5397#discussion_r1114836649


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java:
##########
@@ -1122,6 +1124,7 @@ public void copyBlock(final ExtendedBlock block,
       datanode.metrics.incrBytesRead((int) read);
       datanode.metrics.incrBlocksRead();
       datanode.metrics.incrTotalReadTime(duration);
+      datanode.metrics.addReadTransferRateMBs(DFSUtil.transferRateMBs(read, 
duration));

Review Comment:
   You will be publishing the metrics, including the -1 here. Assuming duration 
is 0, I would expect bytes read to be 0 as well (only instance with sub 
millisecond transfers should be when there's an error prior to the transfer). 
   
   Bytes Read 0, Duration 0: Return 0.
   Bytes Read N, duration 0: Exception which we log.
   Bytes Read N, duration K: Normal



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to