activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r828121 - in /activemq/sandbox/activemq-apollo/hawtdb/src: main/java/org/apache/hawtdb/api/ test/java/org/apache/hawtdb/internal/index/ test/java/org/apache/hawtdb/internal/page/
Date Wed, 21 Oct 2009 18:06:45 GMT
Author: chirino
Date: Wed Oct 21 18:06:44 2009
New Revision: 828121

URL: http://svn.apache.org/viewvc?rev=828121&view=rev
Log:
Working on benchmarks

Modified:
    activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/api/HashIndexFactory.java
    activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/BTreeIndexBenchmark.java
    activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/HashIndexBenchmark.java
    activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/page/TransactionBenchmarker.java

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/api/HashIndexFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/api/HashIndexFactory.java?rev=828121&r1=828120&r2=828121&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/api/HashIndexFactory.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/api/HashIndexFactory.java
Wed Oct 21 18:06:44 2009
@@ -107,6 +107,10 @@
     public void setBucketCapacity(int binCapacity) {
         this.initialBucketCapacity = binCapacity;
     }
+
+    public void setFixedCapacity(int value) {
+        this.minimumBucketCapacity = this.maximumBucketCapacity = this.initialBucketCapacity
= value;
+    }
     
     
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/BTreeIndexBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/BTreeIndexBenchmark.java?rev=828121&r1=828120&r2=828121&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/BTreeIndexBenchmark.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/BTreeIndexBenchmark.java
Wed Oct 21 18:06:44 2009
@@ -33,7 +33,7 @@
         BTreeIndexFactory<Long, Buffer> factory = new BTreeIndexFactory<Long, Buffer>();
         factory.setKeyMarshaller(LongMarshaller.INSTANCE);
         factory.setValueMarshaller(new FixedBufferMarshaller(DATA.length));
-        return factory.open(tx, tx.allocator().alloc(1));
+        return factory.create(tx, tx.allocator().alloc(1));
     }
 
 }

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/HashIndexBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/HashIndexBenchmark.java?rev=828121&r1=828120&r2=828121&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/HashIndexBenchmark.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/index/HashIndexBenchmark.java
Wed Oct 21 18:06:44 2009
@@ -30,11 +30,16 @@
  */
 public class HashIndexBenchmark extends IndexBenchmark {
 
+    public HashIndexBenchmark() {
+        this.benchmark.setSamples(3);
+    }
+    
     protected Index<Long, Buffer> createIndex(Transaction tx) {
         HashIndexFactory<Long, Buffer> factory = new HashIndexFactory<Long, Buffer>();
         factory.setKeyMarshaller(LongMarshaller.INSTANCE);
         factory.setValueMarshaller(new FixedBufferMarshaller(DATA.length));
-        return factory.open(tx, tx.allocator().alloc(1));
+        factory.setFixedCapacity(1024*100);
+        return factory.create(tx, tx.allocator().alloc(1));
     }
     
 }

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/page/TransactionBenchmarker.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/page/TransactionBenchmarker.java?rev=828121&r1=828120&r2=828121&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/page/TransactionBenchmarker.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/test/java/org/apache/hawtdb/internal/page/TransactionBenchmarker.java
Wed Oct 21 18:06:44 2009
@@ -32,12 +32,15 @@
  */
 public class TransactionBenchmarker<A extends TransactionActor<A>> {
     
+    
     public interface Callback {
         public void run(HawtPageFileFactory pff) throws Exception;
     }
     
     private Callback setup;
     private Callback tearDown;
+    private int samples = 3;
+    private int period = 1000*5;
     
     public void benchmark(int actorCount, BenchmarkAction<A> action) throws Exception
{
         HawtPageFileFactory pff = new HawtPageFileFactory();
@@ -50,6 +53,8 @@
             }
             HawtPageFile pf = pff.getConcurrentPageFile();
             Benchmarker benchmark = new Benchmarker();
+            benchmark.setSamples(samples);
+            benchmark.setPeriod(period);
             benchmark.setName(action.getName());
             ArrayList<A> actors = createActors(pf, actorCount, action);
             benchmark.benchmark(actors, createMetrics(action));
@@ -103,6 +108,22 @@
     public void setTearDown(Callback tearDown) {
         this.tearDown = tearDown;
     }
+
+    public int getSamples() {
+        return samples;
+    }
+
+    public void setSamples(int samples) {
+        this.samples = samples;
+    }
+
+    public int getPeriod() {
+        return period;
+    }
+
+    public void setPeriod(int period) {
+        this.period = period;
+    }
     
     
 }



Mime
View raw message