added a perf test

This commit is contained in:
noblepaul 2020-12-14 18:54:32 +11:00
parent ccf3e60453
commit a2a811a1b4
1 changed files with 16 additions and 0 deletions

View File

@ -18,11 +18,15 @@ package org.apache.solr.schema;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.CommandOperation;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.util.TestHarness;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
import java.io.StringReader;
import java.util.Arrays;
import java.util.List;
public class TestSchemaManager extends SolrTestCaseJ4 {
@ -70,4 +74,16 @@ public class TestSchemaManager extends SolrTestCaseJ4 {
assertEquals(2,ops.size());
assertTrue(CommandOperation.captureErrors(ops).isEmpty());
}
@Test
@Ignore
public void testSchemaLoadingPerf() {
SolrConfig config = TestHarness.createConfig(testSolrHome, "collection1", "solrconfig.xml");
List<String> names = Arrays.asList("schema.xml", "schema11.xml", "schema12.xml", "schema15.xml");
long start = System.currentTimeMillis();
for (String name : names) {
IndexSchema schema = IndexSchemaFactory.buildIndexSchema(name, config);
}
System.out.println("time taken : "+ (System.currentTimeMillis() -start));
}
}