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/06/23 16:52:13 UTC

[GitHub] [pulsar] merlimat commented on a diff in pull request #16197: [broker][monitoring] Support gzip compression when expose metrics data

merlimat commented on code in PR #16197:
URL: https://github.com/apache/pulsar/pull/16197#discussion_r905256960


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java:
##########
@@ -318,4 +298,40 @@ private static void generateManagedLedgerBookieClientMetrics(PulsarService pulsa
             // nop
         }
     }
+
+
+    private static void writeOutMetricData(OutputStream out, ByteBuf buffer, boolean exposeBufferMetrics,
+                                           boolean enableCompress) throws IOException {
+        try {
+            if (enableCompress) {
+                out = new GZIPOutputStream(out);

Review Comment:
   I think `GZIPOutputStream` will create a lot of garbage on the JVM heap :| 
   
   Could we just use `org.apache.pulsar.common.compression.CompressionCodecZLib` on the buffer?



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