activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1306567 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/ apollo-dto/src/main/java/org/apache/ac...
Date Wed, 28 Mar 2012 20:11:48 GMT
Author: chirino
Date: Wed Mar 28 20:11:48 2012
New Revision: 1306567

URL: http://svn.apache.org/viewvc?rev=1306567&view=rev
Log:
Fixes APLO-175: Adds a disk_usage metric to stores.

Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala?rev=1306567&r1=1306566&r2=1306567&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
Wed Mar 28 20:11:48 2012
@@ -28,6 +28,7 @@ import org.apache.activemq.apollo.dto.St
 import org.apache.activemq.apollo.util.OptionSupport._
 import java.io.{InputStream, OutputStream}
 import org.fusesource.hawtbuf.Buffer
+import FileSupport._
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -225,6 +226,11 @@ class BDBStore(var config:BDBStoreDTO) e
   def get_store_status(callback:(StoreStatusDTO)=>Unit) = dispatch_queue {
     val rc = new BDBStoreStatusDTO
     fill_store_status(rc)
+    for( file <- config.directory.recursive_list ) {
+      if(!file.isDirectory) {
+        rc.disk_usage += file.length()
+      }
+    }
     rc.message_load_batch_size = message_load_batch_size
     callback(rc)
   }

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade?rev=1306567&r1=1306566&r2=1306567&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
Wed Mar 28 20:11:48 2012
@@ -26,6 +26,7 @@ h1 Store: #{id}
 p state: #{state} for #{ uptime(state_since) }
 
 p pending stores: #{pending_stores}
+p disk usage: #{memory(disk_usage)}
 
 h2 Cancel Stats
 p canceled message stores: #{canceled_message_counter}

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java?rev=1306567&r1=1306566&r2=1306567&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
Wed Mar 28 20:11:48 2012
@@ -41,6 +41,12 @@ public abstract class StoreStatusDTO ext
 	public String state;
 
     /**
+     * The amount of disk space the store is using.
+     */
+	@XmlAttribute(name="disk_usage")
+	public long disk_usage;
+
+    /**
      * Since when has the service been in in this state?  In milliseconds since the epoch.

      */
 	@XmlAttribute(name="state_since")

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala?rev=1306567&r1=1306566&r2=1306567&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
Wed Mar 28 20:11:48 2012
@@ -30,7 +30,7 @@ import org.apache.activemq.apollo.util.O
 import java.io._
 import org.apache.activemq.apollo.web.resources.ViewHelper
 import org.fusesource.hawtbuf.Buffer
-
+import FileSupport._
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
@@ -285,6 +285,11 @@ class LevelDBStore(val config: LevelDBSt
   def get_store_status(callback: (StoreStatusDTO) => Unit) = dispatch_queue {
     val rc = new LevelDBStoreStatusDTO
     fill_store_status(rc)
+    for( file <- config.directory.recursive_list ) {
+      if(!file.isDirectory) {
+        rc.disk_usage += file.length()
+      }
+    }
     rc.message_load_batch_size = message_load_batch_size
     write_executor {
       client.using_index {

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade?rev=1306567&r1=1306566&r2=1306567&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade
Wed Mar 28 20:11:48 2012
@@ -28,6 +28,7 @@ h1 Store: #{id}
 p state: #{state} for #{ uptime(state_since) }
 
 p pending stores: #{pending_stores}
+p disk usage: #{memory(disk_usage)}
 
 h2 Cancel Stats
 p canceled message stores: #{canceled_message_counter}



Mime
View raw message