Skip to content

Instantly share code, notes, and snippets.

View trnl's full-sized avatar

Vova Mihura trnl

View GitHub Profile
@trnl
trnl / CPUTime.java
Created May 21, 2012 09:21
Time configuration for Contiperf2
package org.databene.contiperf.time;
import org.databene.contiperf.Time;
import java.lang.management.ManagementFactory;
/**
* @author Uladzimir Mihura
* Date: 5/16/12
* Time: 6:24 PM
import com.mongodb.*;
import org.bson.BSON;
import java.util.regex.Pattern;
/**
* @author trnl
* Date: 12/27/11
* Time: 3:49 PM
*/
DBCollection c = mongo.getDB(Constants.DB_NAME).getCollection("B");
for (int i = 0; i < 100; i++) {
cursors.add(c.find().limit(10).batchSize(1));
}
for (int i = 0; i < 10; i++) {
for (DBCursor cursor : cursors) {
cursor.next();
}
}