activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1372517 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ apol...
Date Mon, 13 Aug 2012 17:08:29 GMT
Author: chirino
Date: Mon Aug 13 17:08:29 2012
New Revision: 1372517

URL: http://svn.apache.org/viewvc?rev=1372517&view=rev
Log:
Implements APLO-239: Aggregate connection-level messages (and bytes) metrics at connector
and broker level

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.jade

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
Mon Aug 13 17:08:29 2012
@@ -122,6 +122,11 @@ class AcceptingConnector(val broker:Brok
 
   def socket_address = Option(transport_server).map(_.getSocketAddress).getOrElse(null)
 
+  var dead_messages_sent:Long = 0
+  var dead_messages_received:Long = 0
+  var dead_read_counter:Long = 0
+  var dead_write_counter:Long = 0
+
   def status = {
     val result = new ConnectorStatusDTO
     result.id = id.toString
@@ -132,8 +137,20 @@ class AcceptingConnector(val broker:Brok
     result.protocol = Option(config.protocol).getOrElse("any")
     result.local_address = Option(socket_address).map(_.toString).getOrElse("any")
 
+    result.messages_sent = dead_messages_sent
+    result.messages_received = dead_messages_received
+    result.read_counter = dead_read_counter
+    result.write_counter = dead_write_counter
+
     for( (id, connection) <- broker.connections if connection.connector eq this ) {
       result.connections.add( new LongIdLabeledDTO(id, connection.transport.getRemoteAddress.toString
) )
+      val status = connection.get_connection_status
+      if( status!=null ) {
+        result.messages_sent += status.messages_sent
+        result.messages_received += status.messages_received
+        result.read_counter += status.read_counter
+        result.write_counter += status.write_counter
+      }
     }
     result
   }
@@ -292,6 +309,13 @@ class AcceptingConnector(val broker:Brok
     val at_limit = at_connection_limit
     if( broker.connections.remove(connection.id).isDefined ) {
       connected.decrementAndGet()
+      val status = connection.get_connection_status
+      if( status!=null ) {
+        dead_messages_sent += status.messages_sent
+        dead_messages_received += status.messages_received
+        dead_read_counter += status.read_counter
+        dead_write_counter += status.write_counter
+      }
       if( at_limit ) {
         transport_server.resume
       }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
Mon Aug 13 17:08:29 2012
@@ -80,4 +80,33 @@ public class BrokerStatusDTO extends Ser
      */
     @XmlElement(name="connection")
     public List<LongIdLabeledDTO> connections = new ArrayList<LongIdLabeledDTO>();
+
+    /**
+     * The number of messages that have been sent to connections created
+     * by this broker.
+     */
+	@XmlAttribute(name="messages_sent")
+	public long messages_sent;
+
+    /**
+     * The number of messages that have been received from connections created
+     * by this broker.
+     */
+	@XmlAttribute(name="messages_received")
+	public long messages_received;
+
+    /**
+     * The number of bytes that have been read from the connections created by this
+     * broker.
+     */
+	@XmlAttribute(name="read_counter")
+	public long read_counter;
+
+    /**
+     * The number of bytes that have been written to the connections created by this
+     * broker.
+     */
+	@XmlAttribute(name="write_counter")
+	public long write_counter;
+
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
Mon Aug 13 17:08:29 2012
@@ -62,4 +62,32 @@ public class ConnectorStatusDTO extends 
     @XmlElement(name="connection")
     public List<LongIdLabeledDTO> connections = new ArrayList<LongIdLabeledDTO>();
 
+    /**
+     * The number of messages that have been sent to connections created
+     * by this connector.
+     */
+	@XmlAttribute(name="messages_sent")
+	public long messages_sent;
+
+    /**
+     * The number of messages that have been received from connections created
+     * by this connector.
+     */
+	@XmlAttribute(name="messages_received")
+	public long messages_received;
+
+    /**
+     * The number of bytes that have been read from the connections created by this
+     * connector.
+     */
+	@XmlAttribute(name="read_counter")
+	public long read_counter;
+
+    /**
+     * The number of bytes that have been written to the connections created by this
+     * connector.
+     */
+	@XmlAttribute(name="write_counter")
+	public long write_counter;
+
 }

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
Mon Aug 13 17:08:29 2012
@@ -121,8 +121,17 @@ class BrokerResource() extends Resource 
         broker.virtual_hosts.values.foreach{ host=>
           result.virtual_hosts.add( host.id )
         }
+
         broker.connectors.values.foreach{ c=>
           result.connectors.add( c.id )
+          val status = c.status
+          status match {
+            case status:ConnectorStatusDTO =>
+              result.messages_sent += status.messages_sent
+              result.messages_received += status.messages_received
+              result.read_counter += status.read_counter
+              result.write_counter += status.write_counter
+          }
         }
 
         // only include the connection list if it was requested.

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.jade?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.jade
Mon Aug 13 17:08:29 2012
@@ -41,6 +41,10 @@ ul
 h2 Connections
 p total connections since startup : #{connection_counter}
 p currently connected : #{connected}
+p messages received from connections: #{messages_received}
+p messages sent to connections: #{messages_sent}
+p bytes read from connections: #{memory(read_counter)}
+p bytes written to connections: #{memory(write_counter)}
 p
   - if( connections==null )
     a(href={ "broker.html?connections=true" }) Show Connections

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.jade?rev=1372517&r1=1372516&r2=1372517&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.jade
Mon Aug 13 17:08:29 2012
@@ -36,6 +36,11 @@ p protocol: #{protocol}
 h2 Connections
 p total connections since startup : #{connection_counter}
 p currently connected : #{connected}
+p messages received from connections: #{messages_received}
+p messages sent to connections: #{messages_sent}
+p bytes read from connections: #{memory(read_counter)}
+p bytes written to connections: #{memory(write_counter)}
+
 p
   - if( connections==null )
     a(href={ id+".html?connections=true" }) Show Connections



Mime
View raw message