use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CreateIndexTaskTest method testNoMergeScheduler.
public void testNoMergeScheduler() throws Exception {
PerfRunData runData = createPerfRunData(null);
runData.getConfig().set("merge.scheduler", NoMergeScheduler.class.getName());
new CreateIndexTask(runData).doLogic();
new CloseIndexTask(runData).doLogic();
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class CreateIndexTaskTest method testInfoStream_SystemOutErr.
public void testInfoStream_SystemOutErr() throws Exception {
PrintStream curOut = System.out;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
System.setOut(new PrintStream(baos, false, Charset.defaultCharset().name()));
try {
PerfRunData runData = createPerfRunData("SystemOut");
CreateIndexTask cit = new CreateIndexTask(runData);
cit.doLogic();
new CloseIndexTask(runData).doLogic();
assertTrue(baos.size() > 0);
} finally {
System.setOut(curOut);
}
PrintStream curErr = System.err;
baos.reset();
System.setErr(new PrintStream(baos, false, Charset.defaultCharset().name()));
try {
PerfRunData runData = createPerfRunData("SystemErr");
CreateIndexTask cit = new CreateIndexTask(runData);
cit.doLogic();
new CloseIndexTask(runData).doLogic();
assertTrue(baos.size() > 0);
} finally {
System.setErr(curErr);
}
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class PerfTaskTest method createPerfRunData.
private PerfRunData createPerfRunData(boolean setLogStep, int logStepVal, boolean setTaskLogStep, int taskLogStepVal) throws Exception {
Properties props = new Properties();
if (setLogStep) {
props.setProperty("log.step", Integer.toString(logStepVal));
}
if (setTaskLogStep) {
props.setProperty("log.step.MyPerf", Integer.toString(taskLogStepVal));
}
// no accidental FS dir.
props.setProperty("directory", "RAMDirectory");
Config config = new Config(props);
return new PerfRunData(config);
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class PerfTaskTest method doLogStepTest.
private void doLogStepTest(boolean setLogStep, int logStepVal, boolean setTaskLogStep, int taskLogStepVal, int expLogStepValue) throws Exception {
PerfRunData runData = createPerfRunData(setLogStep, logStepVal, setTaskLogStep, taskLogStepVal);
MyPerfTask mpt = new MyPerfTask(runData);
assertEquals(expLogStepValue, mpt.getLogStep());
}
use of org.apache.lucene.benchmark.byTask.PerfRunData in project lucene-solr by apache.
the class SearchWithSortTaskTest method testSetParams_docField.
public void testSetParams_docField() throws Exception {
SearchWithSortTask task = new SearchWithSortTask(new PerfRunData(new Config(new Properties())));
task.setParams("doc");
assertEquals(SortField.Type.DOC, task.getSort().getSort()[0].getType());
}
Aggregations