qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject qpid-broker-j git commit: QPID-8181: [Broker-J] Add statistics for a total number of messaging connections made to virtualhost
Date Tue, 22 May 2018 20:59:47 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 711e00762 -> 830c31837


QPID-8181: [Broker-J] Add statistics for a total number of messaging connections made to virtualhost


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/830c3183
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/830c3183
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/830c3183

Branch: refs/heads/master
Commit: 830c3183735df7169c05b52cb71f0a6a1af5af39
Parents: 711e007
Author: Alex Rudyy <orudyy@apache.org>
Authored: Tue May 22 21:45:07 2018 +0100
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Tue May 22 21:56:40 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/qpid/server/model/port/AmqpPort.java     | 2 +-
 .../apache/qpid/server/virtualhost/AbstractVirtualHost.java  | 8 ++++++++
 .../qpid/server/virtualhost/QueueManagingVirtualHost.java    | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/830c3183/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPort.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPort.java b/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPort.java
index 9145889..c1144d1 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPort.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPort.java
@@ -168,7 +168,7 @@ public interface AmqpPort<X extends AmqpPort<X>> extends Port<X>
     int getConnectionCount();
 
     @ManagedStatistic(statisticType = StatisticType.CUMULATIVE, units = StatisticUnit.COUNT,
label = "Total Connections",
-            description = "Total number of connections made through this port")
+            description = "Total number of connections made through this port since broker
startup")
     long getTotalConnectionCount();
 
     @DerivedAttribute(description = "Maximum time allowed for a new connection to send a
protocol header."

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/830c3183/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
index ff81b07..9f4a513 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
@@ -185,6 +185,7 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
     private final AtomicLong _transactedMessagesOut = new AtomicLong();
     private final AtomicLong _bytesIn = new AtomicLong();
     private final AtomicLong _bytesOut = new AtomicLong();
+    private final AtomicLong _totalConnectionCount = new AtomicLong();
 
     private volatile LinkRegistryModel _linkRegistry;
     private AtomicBoolean _blocked = new AtomicBoolean();
@@ -2263,6 +2264,12 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
     }
 
     @Override
+    public long getTotalConnectionCount()
+    {
+        return _totalConnectionCount.get();
+    }
+
+    @Override
     public int getHousekeepingThreadCount()
     {
         return _housekeepingThreadCount;
@@ -2458,6 +2465,7 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
                     if (connectionEstablishmentPolicy.mayEstablishNewConnection(_connections,
connection))
                     {
                         _connections.add(connection);
+                        _totalConnectionCount.incrementAndGet();
 
                         if (_blocked.get())
                         {

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/830c3183/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
index 9388304..6cee2a0 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
@@ -223,6 +223,11 @@ public interface QueueManagingVirtualHost<X extends QueueManagingVirtualHost<X>>
                       description = "Current number of messaging connections made to this
virtualhost.")
     long getConnectionCount();
 
+    @ManagedStatistic(statisticType = StatisticType.CUMULATIVE, units = StatisticUnit.COUNT,
label = "Total Connections",
+            description = "Total number of messaging connections made to this virtualhost
since broker startup")
+    long getTotalConnectionCount();
+
+
     @SuppressWarnings("unused")
     @ManagedStatistic(statisticType = StatisticType.CUMULATIVE, units = StatisticUnit.BYTES,
label = "Inbound",
                       description = "Total size of all messages received by this virtualhost.")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message