You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/08/09 09:55:13 UTC

[GitHub] [pulsar] tisonkun commented on a diff in pull request #20720: [fix][broker] Fix missing generate some metrics in BrokerOperabilityMetrics

tisonkun commented on code in PR #20720:
URL: https://github.com/apache/pulsar/pull/20720#discussion_r1288242288


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/BrokerOperabilityMetrics.java:
##########
@@ -60,8 +60,8 @@ public List<Metrics> getMetrics() {
         return metricsList;
     }
 
-    private void generate() {
-        metricsList.add(getOldTopicLoadMetrics());
+    private synchronized void generate() {

Review Comment:
   If we always generate a brand new `metricsList`, maybe we can move it to a local variable and merge `generate` into `getMetrics`? This can also drop the `synchronized` modifier.



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