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();
}
}
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);
}
}
Aggregations