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 2021/06/25 17:31:52 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #11024: [PIP-82] [pulsar-broker] Resource group metrics

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

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