use RTimer

This commit is contained in:
noblepaul 2020-12-14 19:03:31 +11:00
parent a2a811a1b4
commit 63943a739b
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package org.apache.solr.schema;
import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.CommandOperation; import org.apache.solr.common.util.CommandOperation;
import org.apache.solr.core.SolrConfig; import org.apache.solr.core.SolrConfig;
import org.apache.solr.util.RTimer;
import org.apache.solr.util.TestHarness; import org.apache.solr.util.TestHarness;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Ignore; import org.junit.Ignore;
@ -80,10 +81,10 @@ public class TestSchemaManager extends SolrTestCaseJ4 {
public void testSchemaLoadingPerf() { public void testSchemaLoadingPerf() {
SolrConfig config = TestHarness.createConfig(testSolrHome, "collection1", "solrconfig.xml"); SolrConfig config = TestHarness.createConfig(testSolrHome, "collection1", "solrconfig.xml");
List<String> names = Arrays.asList("schema.xml", "schema11.xml", "schema12.xml", "schema15.xml"); List<String> names = Arrays.asList("schema.xml", "schema11.xml", "schema12.xml", "schema15.xml");
long start = System.currentTimeMillis(); RTimer timer = new RTimer();
for (String name : names) { for (String name : names) {
IndexSchema schema = IndexSchemaFactory.buildIndexSchema(name, config); IndexSchema schema = IndexSchemaFactory.buildIndexSchema(name, config);
} }
System.out.println("time taken : "+ (System.currentTimeMillis() -start)); System.out.println(timer.stop());
} }
} }