activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1233705 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java
Date Fri, 20 Jan 2012 00:38:30 GMT
Author: chirino
Date: Fri Jan 20 00:38:29 2012
New Revision: 1233705

URL: http://svn.apache.org/viewvc?rev=1233705&view=rev
Log:
Improve the accuracy of swapped in tracking.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1233705&r1=1233704&r2=1233705&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Fri Jan 20 00:38:29 2012
@@ -244,8 +244,8 @@ class Queue(val router: LocalRouter, val
   var auto_delete_after = 0
   var idled_at = 0L
 
-  def swapped_in_items = this.producer_swapped_in.items + this.consumer_swapped_in.items
-  def swapped_in_size = this.producer_swapped_in.size + this.consumer_swapped_in.size
+  var loaded_items = 0
+  var loaded_size = 0
   def swapped_in_size_max = this.producer_swapped_in.size_max + this.consumer_swapped_in.size_max
 
   def get_queue_metrics:DestMetricsDTO = {
@@ -279,8 +279,8 @@ class Queue(val router: LocalRouter, val
     rc.swapping_in_size = this.swapping_in_size
     rc.swapping_out_size = this.swapping_out_size
 
-    rc.swapped_in_items = swapped_in_items
-    rc.swapped_in_size = swapped_in_size
+    rc.swapped_in_items = this.loaded_items
+    rc.swapped_in_size = this.loaded_size
     rc.swapped_in_size_max = swapped_in_size_max
 
     rc.producer_counter = this.producer_counter
@@ -593,7 +593,7 @@ class Queue(val router: LocalRouter, val
   }
 
   def display_stats: Unit = {
-    info("contains: %d messages worth %,.2f MB of data, producers are %s, %d/%d buffer space
used.", queue_items, (queue_size.toFloat / (1024 * 1024)), {if (messages.full) "being throttled"
else "not being throttled"}, swapped_in_size, swapped_in_size_max)
+    info("contains: %d messages worth %,.2f MB of data, producers are %s, %d/%d buffer space
used.", queue_items, (queue_size.toFloat / (1024 * 1024)), {if (messages.full) "being throttled"
else "not being throttled"}, loaded_size, swapped_in_size_max)
     info("total messages enqueued %d, dequeues %d ", enqueue_item_counter, dequeue_item_counter)
   }
 
@@ -1338,6 +1338,9 @@ class QueueEntry(val queue:Queue, val se
     var swapping_out = false
     var storing = false
 
+    queue.loaded_items += 1
+    queue.loaded_size += size
+
     def label = {
       var rc = "loaded"
       if( acquired ) {
@@ -1439,6 +1442,9 @@ class QueueEntry(val queue:Queue, val se
         }
         if( remove_pending ) {
           state.remove
+        } else {
+          queue.loaded_items -= 1
+          queue.loaded_size -= size
         }
       } else {
         if( remove_pending ) {
@@ -1462,6 +1468,8 @@ class QueueEntry(val queue:Queue, val se
     }
 
     override def remove = {
+      queue.loaded_items -= 1
+      queue.loaded_size -= size
       if( storing | remove_pending ) {
         remove_pending = true
       } else {

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java?rev=1233705&r1=1233704&r2=1233705&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestMetricsDTO.java
Fri Jan 20 00:38:29 2012
@@ -170,35 +170,35 @@ public class DestMetricsDTO {
      * or swap messages to persistent storage once this limit is reached.
      */
     @XmlAttribute(name="swapped_in_size_max")
-    public int swapped_in_size_max;
+    public long swapped_in_size_max;
 
     /**
      * The total size in bytes of messages that are resident in
      * the broker's RAM.
      */
     @XmlAttribute(name="swapped_in_size")
-    public int swapped_in_size;
+    public long swapped_in_size;
 
     /**
      * The total number of messages that are resident in
      * the broker's RAM.
      */
     @XmlAttribute(name="swapped_in_items")
-    public int swapped_in_items;
+    public long swapped_in_items;
 
     /**
      * The total size in bytes of messages that are being
      * loaded from persistent storage into RAM
      */
     @XmlAttribute(name="swapping_in_size")
-    public int swapping_in_size;
+    public long swapping_in_size;
 
     /**
      * The total size in bytes of messages that are being
      * evicted from RAM into persistent storage.
      */
     @XmlAttribute(name="swapping_out_size")
-    public int swapping_out_size;
+    public long swapping_out_size;
 
     /**
      * The total number of messages that have ever been



Mime
View raw message