jerrypeng commented on a change in pull request #11024:
URL: https://github.com/apache/pulsar/pull/11024#discussion_r658928992



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java
##########
@@ -197,6 +201,7 @@ public void registerTenant(String resourceGroupName, String 
tenantName) throws P
 
         // Associate this tenant name with the RG.
         this.tenantToRGsMap.put(tenantName, rg);
+        rgTenantRegisters.labels(resourceGroupName).inc();

Review comment:
       I would suggest you cache rgTenantRegisters.labels(resourceGroupName) so 
that you don't have to call it every single time to add a metric.  `labels()` 
allocates a new array list every time you call the method




-- 
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-unsubscr...@pulsar.apache.org

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


Reply via email to