xichen01 commented on code in PR #5644:
URL: https://github.com/apache/ozone/pull/5644#discussion_r1405354115
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -113,6 +116,8 @@ public Response get(
@Context HttpHeaders hh) throws OS3Exception, IOException {
long startNanos = Time.monotonicNowNanos();
S3GAction s3GAction = S3GAction.GET_BUCKET;
+ Map<String, String> perf = new HashMap<>();
Review Comment:
Using the `PerformanceStringBuilder` guarantees a stable order.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/audit/AuditMessage.java:
##########
@@ -109,15 +113,23 @@ public Builder withException(Throwable ex) {
return this;
}
+ public Builder setPerformance(Map<String, String> perf) {
+ this.performance = perf;
+ return this;
+ }
+
public AuditMessage build() {
- return new AuditMessage(user, ip, op, params, ret, throwable);
+ return new AuditMessage(user, ip, op, params, ret, throwable,
+ performance);
}
}
private String formMessage(String userStr, String ipStr, String opStr,
- Map<String, String> paramsMap, String retStr) {
+ Map<String, String> paramsMap, String retStr,
+ Map<String, String> performanceMap) {
return "user=" + userStr + " | ip=" + ipStr + " | " + "op=" + opStr
- + " " + paramsMap + " | " + "ret=" + retStr;
+ + " " + paramsMap + " performance=" + performanceMap
+ + " | ret=" + retStr;
Review Comment:
Done.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -264,12 +269,16 @@ public Response get(
response.setTruncated(false);
}
- AUDIT.logReadSuccess(buildAuditMessageForSuccess(s3GAction,
- getAuditParameters()));
int keyCount =
response.getCommonPrefixes().size() + response.getContents().size();
- getMetrics().updateGetBucketSuccessStats(startNanos);
+ long getBucketLatency =
+ getMetrics().updateGetBucketSuccessStats(startNanos);
getMetrics().incListKeyCount(keyCount);
+ perf.put("getBucketKeyCount", String.valueOf(keyCount));
+ perf.put("getBucketLatencyMs",
Review Comment:
Done.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/audit/AuditMessage.java:
##########
@@ -109,15 +113,23 @@ public Builder withException(Throwable ex) {
return this;
}
+ public Builder setPerformance(Map<String, String> perf) {
+ this.performance = perf;
+ return this;
+ }
+
public AuditMessage build() {
- return new AuditMessage(user, ip, op, params, ret, throwable);
+ return new AuditMessage(user, ip, op, params, ret, throwable,
+ performance);
}
}
private String formMessage(String userStr, String ipStr, String opStr,
- Map<String, String> paramsMap, String retStr) {
+ Map<String, String> paramsMap, String retStr,
+ Map<String, String> performanceMap) {
return "user=" + userStr + " | ip=" + ipStr + " | " + "op=" + opStr
- + " " + paramsMap + " | " + "ret=" + retStr;
+ + " " + paramsMap + " performance=" + performanceMap
+ + " | ret=" + retStr;
Review Comment:
Done.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -113,6 +116,8 @@ public Response get(
@Context HttpHeaders hh) throws OS3Exception, IOException {
long startNanos = Time.monotonicNowNanos();
S3GAction s3GAction = S3GAction.GET_BUCKET;
+ Map<String, String> perf = new HashMap<>();
Review Comment:
Using the `PerformanceStringBuilder` guarantees a stable order.
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -113,6 +116,8 @@ public Response get(
@Context HttpHeaders hh) throws OS3Exception, IOException {
long startNanos = Time.monotonicNowNanos();
S3GAction s3GAction = S3GAction.GET_BUCKET;
+ Map<String, String> perf = new HashMap<>();
Review Comment:
Using the `PerformanceStringBuilder` guarantees a stable order.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/audit/AuditMessage.java:
##########
@@ -109,15 +113,23 @@ public Builder withException(Throwable ex) {
return this;
}
+ public Builder setPerformance(Map<String, String> perf) {
+ this.performance = perf;
+ return this;
+ }
+
public AuditMessage build() {
- return new AuditMessage(user, ip, op, params, ret, throwable);
+ return new AuditMessage(user, ip, op, params, ret, throwable,
+ performance);
}
}
private String formMessage(String userStr, String ipStr, String opStr,
- Map<String, String> paramsMap, String retStr) {
+ Map<String, String> paramsMap, String retStr,
+ Map<String, String> performanceMap) {
return "user=" + userStr + " | ip=" + ipStr + " | " + "op=" + opStr
- + " " + paramsMap + " | " + "ret=" + retStr;
+ + " " + paramsMap + " performance=" + performanceMap
+ + " | ret=" + retStr;
Review Comment:
Done.
--
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]