activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r759314 - in /activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store: StorePerformanceBase.java kahadb/KahaDBStorePerformance.java
Date Fri, 27 Mar 2009 19:32:28 GMT
Author: chirino
Date: Fri Mar 27 19:32:28 2009
New Revision: 759314

URL: http://svn.apache.org/viewvc?rev=759314&view=rev
Log:
Added a 10_1_1 case

Modified:
    activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
    activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/kahadb/KahaDBStorePerformance.java

Modified: activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java?rev=759314&r1=759313&r2=759314&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
(original)
+++ activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
Fri Mar 27 19:32:28 2009
@@ -35,7 +35,7 @@
 public abstract class StorePerformanceBase extends TestCase {
 
     private static int PERFORMANCE_SAMPLES = 3;
-    private static boolean SYNC_TO_DISK = false;
+    private static boolean SYNC_TO_DISK = true;
     
     
     private Store store;
@@ -44,9 +44,10 @@
     protected MetricAggregator totalProducerRate = new MetricAggregator().name("Aggregate
Producer Rate").unit("items");
     protected MetricAggregator totalConsumerRate = new MetricAggregator().name("Aggregate
Consumer Rate").unit("items");
 
+    protected ArrayList<Consumer> consumers = new ArrayList<Consumer>();
+    protected ArrayList<Producer> producers = new ArrayList<Producer>();
+
     abstract protected Store createStore();
-    abstract protected boolean isStoreTransactional();
-    abstract protected boolean isStorePersistent();
 
     @Override
     protected void setUp() throws Exception {
@@ -64,6 +65,15 @@
 
     @Override
     protected void tearDown() throws Exception {
+        for (Consumer c : consumers) {
+            c.stop();
+        }
+        consumers.clear();
+        for (Producer p : producers) {
+            p.stop();
+        }
+        producers.clear();
+        
         if (store != null) {
             store.stop();
         }
@@ -193,17 +203,31 @@
     }
     
     public void test1_1_1() throws Exception {
-
-        Producer p = new  Producer("1");
-        Consumer c = new  Consumer("1");
-        p.start();
-        c.start();
-        
+        startProducers(1);
+        startConsumers(1);
         reportRates();
-        
-        p.stop();
-        c.stop();
-        
+    }
+    
+    public void test10_1_1() throws Exception {
+        startProducers(10);
+        startConsumers(1);
+        reportRates();
+    }
+
+    private void startProducers(int count) {
+        for (int i = 0; i < count; i++) {
+            Producer p = new  Producer(""+(i+1));
+            producers.add(p);
+            p.start();
+        }
+    }
+    
+    private void startConsumers(int count) {
+        for (int i = 0; i < count; i++) {
+            Consumer c = new  Consumer(""+(i+1));
+            consumers.add(c);
+            c.start();
+        }
     }
     
     private void reportRates() throws InterruptedException {

Modified: activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/kahadb/KahaDBStorePerformance.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/kahadb/KahaDBStorePerformance.java?rev=759314&r1=759313&r2=759314&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/kahadb/KahaDBStorePerformance.java
(original)
+++ activemq/sandbox/activemq-flow/src/test/java/org/apache/activemq/broker/store/kahadb/KahaDBStorePerformance.java
Fri Mar 27 19:32:28 2009
@@ -31,14 +31,4 @@
         return rc;
     }
 
-    @Override
-    protected boolean isStorePersistent() {
-        return true;
-    }
-
-    @Override
-    protected boolean isStoreTransactional() {
-        return true;
-    }
-
 }



Mime
View raw message