You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/02 09:32:18 UTC

[GitHub] [ozone] ArafatKhan2198 commented on a diff in pull request #3302: HDDS-6529. Adding Unit-Test cases for S3-Gateway Object-Endpoint Metrics

ArafatKhan2198 commented on code in PR #3302:
URL: https://github.com/apache/ozone/pull/3302#discussion_r862711528


##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/metrics/TestS3GatewayMetrics.java:
##########
@@ -272,11 +273,367 @@ public void testPutAclFailure() throws Exception {
     assertEquals(1L, curMetric - oriMetric);
   }
 
+
+  /**
+   * Object Level Endpoints.
+   */
+
+  @Test
+  public void testHeadKeySuccess() throws Exception {
+    String value = RandomStringUtils.randomAlphanumeric(32);
+    OzoneOutputStream out = bucket.createKey(keyName,
+        value.getBytes(UTF_8).length, ReplicationType.RATIS,
+        ReplicationFactor.ONE, new HashMap<>());
+    out.write(value.getBytes(UTF_8));
+    out.close();
+
+    // Test for Success of HeadKeySuccess Metric
+    long oriMetric = metrics.getHeadKeySuccess();
+
+    keyEndpoint.head(bucketName, keyName);
+
+    long curMetric = metrics.getHeadKeySuccess();
+    assertEquals(1L, curMetric - oriMetric);
+  }
+
+  @Test
+  public void testHeadKeyFailure() throws Exception {
+    // Test for Failure of HeadKeyFailure Metric

Review Comment:
   I will remove them !!



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