jojochuang commented on code in PR #4383:
URL: https://github.com/apache/ozone/pull/4383#discussion_r1134661307
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -968,6 +987,8 @@ private CopyObjectResponse copyObject(OzoneVolume volume,
CopyObjectResponse copyObjectResponse = new CopyObjectResponse();
copyObjectResponse.setETag(OzoneUtils.getRequestID());
copyObjectResponse.setLastModified(destKeyDetails.getModificationTime());
+ getLatencyMetrics().addCopyObjectLatencyNs(
+ Time.monotonicNowNanos() - start);
Review Comment:
It's fine to do this way. However, it wouldn't record the latency if there's
an exception and doesn't reach here.
Better to do it in the finally clause.
Alternatively, create a wrapper method around the code in copyObject(), and
then you can add captureLatencyNs(() easily.
--
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]