adoroszlai commented on code in PR #4383:
URL: https://github.com/apache/ozone/pull/4383#discussion_r1163856397


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -348,12 +348,16 @@ public Response listMultipartUploads(
       AUDIT.logReadSuccess(buildAuditMessageForSuccess(s3GAction,
           getAuditParameters()));
       getMetrics().incListMultipartUploadsSuccess();
+      getMetrics().addListMultipartUploadsLatencyNs(
+          Time.monotonicNowNanos() - start, true);

Review Comment:
   > I think we could simplify metrics by incrementing operation count and 
recording operation latency in the same method.
   
   Let me clarify my previous comment with an example.
   
   My suggestion is to change `incListMultipartUploadsSuccess()` to 
`listMultipartUploadsSuccess(long startNanos)`, and let it:
    * increment success counter
    * record elapsed time since `startNanos` as latency
   
   This way we could easily ensure that:
    * all operations have both counter and latency
    * each operation records both count and latency together (avoid 
accidentally forgetting to do one or the other)



-- 
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