activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [activemq-artemis] branch master updated: ARTEMIS-2570 Improve performance of ConnectionsView
Date Fri, 06 Dec 2019 17:29:13 GMT
This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ad8391  ARTEMIS-2570 Improve performance of ConnectionsView
     new da0d378  This closes #2911
3ad8391 is described below

commit 3ad8391e9b1cca64b1870f2d1038a644b2b57519
Author: Sebastian Thomschke <sebthom@users.noreply.github.com>
AuthorDate: Fri Dec 6 11:55:48 2019 +0100

    ARTEMIS-2570 Improve performance of ConnectionsView
---
 .../activemq/artemis/core/management/impl/view/ConnectionView.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java
index 4ed0b49..0bf0017 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConnectionView.java
@@ -70,13 +70,11 @@ public class ConnectionView extends ActiveMQAbstractView<RemotingConnection>
{
          .add("protocol", toString(connection.getProtocolName()))
          .add("clientID", toString(connection.getClientID() != null ? connection.getClientID()
: jmsSessionClientID))
          .add("localAddress", toString(connection.getTransportLocalAddress()))
-         .add("sessionCount", server.getSessions(connection.getID().toString()).size());
+         .add("sessionCount", sessions.size());
    }
 
    @Override
    public Object getField(RemotingConnection connection, String fieldName) {
-      List<ServerSession> sessions = server.getSessions(connection.getID().toString());
-
       switch (fieldName) {
          case "connectionID":
             return connection.getID();
@@ -84,6 +82,7 @@ public class ConnectionView extends ActiveMQAbstractView<RemotingConnection>
{
             return connection.getRemoteAddress();
          case "users":
             Set<String> users = new TreeSet<>();
+            List<ServerSession> sessions = server.getSessions(connection.getID().toString());
             for (ServerSession session : sessions) {
                String username = session.getUsername() == null ? "" : session.getUsername();
                users.add(username);
@@ -100,7 +99,7 @@ public class ConnectionView extends ActiveMQAbstractView<RemotingConnection>
{
          case "localAddress":
             return connection.getTransportLocalAddress();
          case "sessionCount":
-            return sessions.size();
+            return server.getSessions(connection.getID().toString()).size();
          default:
             throw new IllegalArgumentException("Unsupported field, " + fieldName);
       }


Mime
View raw message