coder-chenzhi commented on a change in pull request #2358:
URL: https://github.com/apache/hadoop/pull/2358#discussion_r500989847
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
##########
@@ -486,12 +486,11 @@ DatanodeCommand cacheReport() throws IOException {
cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds);
long sendTime = monotonicNow();
- long createCost = createTime - startTime;
long sendCost = sendTime - createTime;
dn.getMetrics().addCacheReport(sendCost);
if (LOG.isDebugEnabled()) {
LOG.debug("CacheReport of " + blockIds.size()
- + " block(s) took " + createCost + " msecs to generate and "
+ + " block(s) took " + (createTime - startTime) + " msecs to
generate and "
Review comment:
IMHO, another reason for this change is that it can improve the
maintainability, as the `sendCost` only used by the logging call. But I will
leave it alone. We can not move the call to `monotonicNow()`, because the
result is also used by `dn.getMetrics().addCacheReport(sendCost)`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]