xuesongxs commented on code in PR #16888:
URL: https://github.com/apache/pulsar/pull/16888#discussion_r960263732


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java:
##########
@@ -349,6 +350,36 @@ public void testBrokerReady() throws Exception {
         assertEquals(res.getResponseBody(), "ok");
     }
 
+    @Test
+    public void testCompressOutputMetricsInPrometheus() throws Exception {
+        compressOutputMetricsInPrometheus = true;
+        setupEnv(true, "1.0", true, false, false, false, -1, false);
+
+        String metricsUrl = pulsar.getWebServiceAddress() + "/metrics";
+
+        @Cleanup
+        AsyncHttpClient metricsClient = new DefaultAsyncHttpClient();
+        Response metricsRes = 
metricsClient.prepareGet(metricsUrl).execute().get();

Review Comment:
   ```
           HttpClient client = new HttpClient();
           client.start();
           ContentResponse response = client.GET(metricsUrl);
           assertEquals(response.getHeaders().get("Content-Encoding"), "gzip");
           client.stop();
   ```
   This code should be used to check.



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

Reply via email to