You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2023/03/13 22:03:49 UTC
[GitHub] [ozone] jojochuang commented on a diff in pull request #4383: HDDS-8147. Introduce latency metrics for S3 Gateway operations
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org