mattrpav commented on code in PR #1288: URL: https://github.com/apache/activemq/pull/1288#discussion_r1812863429
########## activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java: ########## @@ -280,11 +280,21 @@ public ObjectName[] getTopics() { return safeGetBroker().getTopicsNonSuppressed(); } + @Override + public int getTotalTopicsCount() { + return getTopics().length; + } + @Override public ObjectName[] getQueues() { return safeGetBroker().getQueuesNonSuppressed(); } + @Override + public int getTotalQueuesCount() { + return getQueues().length; Review Comment: The current implementation is a -1 for me. There is _zero_ reason to allocate an array, and then shove a bunch of objects into it just to get a count. Proposed path forward: The total queue count should simply come from the queue region and do a quick size on an existing collection. -- 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: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact