You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/05 02:03:44 UTC

[GitHub] [pulsar] xuesongxs commented on a diff in pull request #16888: [improve][broker] Add gzip compression before http service response

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:
##########
@@ -263,6 +264,14 @@ public void addServlet(String path, ServletHolder servletHolder, boolean require
             });
         }
         filterInitializer.addFilters(context, requiresAuthentication);
+        // Enable compress on /metrics endpoint
+        if (path.equals("/metrics") && pulsar.getConfiguration().isEnableCompressMetricsData()) {
+            GzipHandler gzipHandler = new GzipHandler();
+            gzipHandler.setHandler(context);
+            handlers.add(gzipHandler);
+        } else {
+            handlers.add(context);
+        }
         handlers.add(context);

Review Comment:
   > Yes, the code was copied without deletion.
   
   



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org