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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to