activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1242200 - in /activemq/activemq-apollo/trunk: apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/ apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/o...
Date Thu, 09 Feb 2012 01:31:53 GMT
Author: chirino
Date: Thu Feb  9 01:31:52 2012
New Revision: 1242200

URL: http://svn.apache.org/viewvc?rev=1242200&view=rev
Log:
Fixes APLO-154 : Display count of messages produced/consumed

Modified:
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/openwire/dto/OpenwireConnectionStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.jade

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
Thu Feb  9 01:31:52 2012
@@ -61,6 +61,18 @@ public class ConnectionStatusDTO extends
 	public long write_counter;
 
     /**
+     * The number of messages that have been sent to the connection.
+     */
+	@XmlAttribute(name="messages_sent")
+	public long messages_sent;
+
+    /**
+     * The number of messages that have been received from the connection.
+     */
+	@XmlAttribute(name="messages_received")
+	public long messages_received;
+
+    /**
      * The connector that created the connection.
      */
 	@XmlAttribute

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
Thu Feb  9 01:31:52 2012
@@ -119,11 +119,16 @@ class OpenwireProtocolHandler extends Pr
 
   def session_id = security_context.session_id
 
+  var messages_sent = 0L
+  var messages_received = 0L
+
   override def create_connection_status = {
     var rc = new OpenwireConnectionStatusDTO
     rc.protocol_version = ""+(if (wire_format == null) 0 else wire_format.getVersion)
     rc.user = login.map(_.toString).getOrElse(null)
     rc.subscription_count = all_consumers.size
+    rc.messages_sent = messages_sent
+    rc.messages_received = messages_received
     rc.waiting_on = waiting_on()
     rc
   }
@@ -602,6 +607,7 @@ class OpenwireProtocolHandler extends Pr
   ///////////////////////////////////////////////////////////////////
 
   def on_message(msg: ActiveMQMessage) = {
+    messages_received += 1
     val producer = all_producers.get(msg.getProducerId).getOrElse(die("Producer associated
with the message has not been registered."))
 
     if (msg.getOriginalDestination() == null) {
@@ -823,6 +829,7 @@ class OpenwireProtocolHandler extends Pr
         dispatch.setDestination(msg.getDestination)
         dispatch.setMessage(msg)
       }
+      messages_sent += 1
       dispatch
     }, Delivery)
 

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/openwire/dto/OpenwireConnectionStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/openwire/dto/OpenwireConnectionStatusDTO.jade?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/openwire/dto/OpenwireConnectionStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/webapp/WEB-INF/org/apache/activemq/apollo/openwire/dto/OpenwireConnectionStatusDTO.jade
Thu Feb  9 01:31:52 2012
@@ -43,7 +43,9 @@ p waiting on: #{waiting_on}
 
 h4 Metrics
 
-p read counter: #{memory(read_counter)}
-p write counter: #{memory(write_counter)}
+p messages received from the client: #{messages_received}
+p messages sent to the client: #{messages_sent}
+p bytes read counter: #{memory(read_counter)}
+p bytes written counter: #{memory(write_counter)}
 p last read size: #{memory(last_read_size)}
 p last write size: #{memory(last_write_size)}

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Thu Feb  9 01:31:52 2012
@@ -418,6 +418,7 @@ class StompProtocolHandler extends Proto
       if( include_seq.isDefined ) {
         frame = frame.append_headers((include_seq.get, ascii(delivery.seq.toString))::Nil)
       }
+      messages_sent += 1
       frame
     }, Delivery)
 
@@ -645,12 +646,17 @@ class StompProtocolHandler extends Proto
 
   }
 
+  var messages_sent = 0L
+  var messages_received = 0L
+
   override def create_connection_status = {
     var rc = new StompConnectionStatusDTO
     rc.protocol_version = if( protocol_version == null ) null else protocol_version.toString
     rc.user = security_context.user
     rc.subscription_count = consumers.size
     rc.waiting_on = waiting_on()
+    rc.messages_sent = messages_sent
+    rc.messages_received = messages_received
     rc
   }
 
@@ -976,6 +982,7 @@ class StompProtocolHandler extends Proto
   }
 
   def on_stomp_send(frame:StompFrame) = {
+    messages_received += 1
 
     get(frame.headers, DESTINATION) match {
       case None=>
@@ -997,7 +1004,6 @@ class StompProtocolHandler extends Proto
   }
 
   def perform_send(frame:StompFrame, uow:StoreUOW=null): Unit = {
-
     val addresses = decode_addresses(get(frame.headers, DESTINATION).get)
     val key = addresses.toList
     producerRoutes.get(key) match {

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/webapp/WEB-INF/org/apache/activemq/apollo/stomp/dto/StompConnectionStatusDTO.jade
Thu Feb  9 01:31:52 2012
@@ -43,7 +43,9 @@ p waiting on: #{waiting_on}
 
 h4 Metrics
 
-p read counter: #{memory(read_counter)}
-p write counter: #{memory(write_counter)}
+p messages received from the client: #{messages_received}
+p messages sent to the client: #{messages_sent}
+p bytes read counter: #{memory(read_counter)}
+p bytes written counter: #{memory(write_counter)}
 p last read size: #{memory(last_read_size)}
 p last write size: #{memory(last_write_size)}

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.jade?rev=1242200&r1=1242199&r2=1242200&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.jade
Thu Feb  9 01:31:52 2012
@@ -44,7 +44,9 @@ p waiting on: #{waiting_on}
 
 h4 Metrics
 
-p read counter: #{memory(read_counter)}
-p write counter: #{memory(write_counter)}
+p messages received from the client: #{messages_received}
+p messages sent to the client: #{messages_sent}
+p bytes read counter: #{memory(read_counter)}
+p bytes written counter: #{memory(write_counter)}
 p last read size: #{memory(last_read_size)}
 p last write size: #{memory(last_write_size)}



Mime
View raw message