Search in sources :

Example 41 with BenchmarkOptions

use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project DirectMemory by raffaeleguidi.

the class ConcurrentTests method retrieveCatchHalfOfThem.

@BenchmarkOptions(benchmarkRounds = 1000000, warmupRounds = 0, concurrency = 100)
@Test
public void retrieveCatchHalfOfThem() {
    String key = "test-" + (rndGen.nextInt(entries * 2) + 1);
    Pointer p = map.get(key);
    read.incrementAndGet();
    if (p != null) {
        got.incrementAndGet();
        byte[] payload = mem.retrieve(p);
        if (key.equals(new String(payload)))
            good.incrementAndGet();
        else
            bad.incrementAndGet();
    } else {
        missed.incrementAndGet();
    }
}
Also used : Pointer(org.directmemory.memory.Pointer) Test(org.junit.Test) BenchmarkOptions(com.carrotsearch.junitbenchmarks.BenchmarkOptions)

Example 42 with BenchmarkOptions

use of com.carrotsearch.junitbenchmarks.BenchmarkOptions in project mongomvcc by igd-geo.

the class MongoDBVDatabaseBenchmark method mvccInsertDeleteInsertQuery.

/**
 * Queries a lot of objects after inserting, deleting and inserting again
 */
@Test
@BenchmarkOptions(benchmarkRounds = 2, warmupRounds = 1)
public void mvccInsertDeleteInsertQuery() {
    mvccInsertDeleteInsert();
    VCollection coll = _master.getCollection("persons");
    for (Map<String, Object> o : coll.find()) {
        assertTrue(((Long) o.get("age")).longValue() >= DOCUMENTS);
    }
}
Also used : BasicDBObject(com.mongodb.BasicDBObject) DBObject(com.mongodb.DBObject) VCollection(de.fhg.igd.mongomvcc.VCollection) Test(org.junit.Test) BenchmarkOptions(com.carrotsearch.junitbenchmarks.BenchmarkOptions)

Aggregations

BenchmarkOptions (com.carrotsearch.junitbenchmarks.BenchmarkOptions)42 Test (org.junit.Test)42 DirectByteBufferAllocator (org.apache.parquet.bytes.DirectByteBufferAllocator)10 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)6 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)6 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)6 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)6 ByteBufferInputStream (org.apache.parquet.bytes.ByteBufferInputStream)6 Binary (org.apache.parquet.io.api.Binary)6 Ignore (org.junit.Ignore)6 ArrayList (java.util.ArrayList)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 Pointer (org.directmemory.memory.Pointer)4 BasicDBObject (com.mongodb.BasicDBObject)3 MutableBitmap (io.druid.collections.bitmap.MutableBitmap)3 LinkedList (java.util.LinkedList)3 MutableBitmap (org.apache.druid.collections.bitmap.MutableBitmap)3 DeltaBinaryPackingValuesWriter (org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesWriter)3 BinaryPlainValuesReader (org.apache.parquet.column.values.plain.BinaryPlainValuesReader)3 PlainValuesWriter (org.apache.parquet.column.values.plain.PlainValuesWriter)3