From ce42bc576d1c239a4aae53092151772d19129a78 Mon Sep 17 00:00:00 2001 From: Fraser Adams Date: Sun, 28 Apr 2013 16:18:40 +0000 Subject: QPID-4783: Improve Connection statistics in Java Broker QmfManagementAgent git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1476792 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/server/qmf2/agentdata/Connection.java | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/agentdata/Connection.java b/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/agentdata/Connection.java index 9a96bfb493..a2b03c7c20 100644 --- a/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/agentdata/Connection.java +++ b/qpid/tools/src/java/src/qpid-broker-plugins-management-qmf2/java/org/apache/qpid/server/qmf2/agentdata/Connection.java @@ -36,6 +36,7 @@ import org.apache.qpid.qmf2.common.SchemaEventClass; import org.apache.qpid.qmf2.common.SchemaObjectClass; //import org.apache.qpid.qmf2.common.SchemaProperty; +import org.apache.qpid.server.model.Statistics; /** * This class provides a concrete implementation of QmfAgentData for the Connection Management Object. @@ -168,7 +169,7 @@ public class Connection extends QmfAgentData } /** - * This method maps the org.apache.qpid.server.model.Connection to QMF2 broker properties where possible then + * This method maps the org.apache.qpid.server.model.Connection to QMF2 connection properties where possible then * serialises into the underlying Map for transmission via AMQP. This method is called by handleQueryRequest() * in the org.apache.qpid.qmf2.agent.Agent class implementing the main QMF2 Agent behaviour. * @@ -177,27 +178,17 @@ public class Connection extends QmfAgentData @Override public Map mapEncode() { -/* - // There isn't yet a way yet in the Java Broker to associate Connections->Sessions->Subscriptions->Queues - System.out.println("Connection name = " + _connection.getName()); - for (org.apache.qpid.server.model.Session session : _connection.getSessions()) - { - System.out.println("Session name = " + session); - } -*/ - - // Statistics - //Statistics stats = _queue.getStatistics(); + Statistics stats = _connection.getStatistics(); // closing Not implemented in Qpid 0.20 setValue("framesFromClient", 0); // framesFromClient Not implemented in Qpid 0.20 setValue("framesToClient", 0); // framesToClient Not implemented in Qpid 0.20 - setValue("bytesFromClient", 0); // bytesFromClient Not implemented in Qpid 0.20 - setValue("bytesToClient", 0); // bytesToClient Not implemented in Qpid 0.20 - setValue("msgsFromClient", 0); // msgsFromClient Not implemented in Qpid 0.20 - setValue("msgsToClient", 0); // msgsToClient Not implemented in Qpid 0.20 + setValue("bytesFromClient", stats.getStatistic("bytesIn")); + setValue("bytesToClient", stats.getStatistic("bytesOut")); + setValue("msgsFromClient", stats.getStatistic("messagesIn")); + setValue("msgsToClient", stats.getStatistic("messagesOut")); - //update(); // TODO set update if statistics change. + update(); // TODO set update if statistics change. return super.mapEncode(); } } -- cgit v1.2.1