From a2a811a1b4e17f3a9c8a3af866d18b7ce26a708a Mon Sep 17 00:00:00 2001 From: noblepaul Date: Mon, 14 Dec 2020 18:54:32 +1100 Subject: [PATCH] added a perf test --- .../apache/solr/schema/TestSchemaManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/schema/TestSchemaManager.java b/solr/core/src/test/org/apache/solr/schema/TestSchemaManager.java index a6f7fc48c58..d4e68e6d2ea 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestSchemaManager.java +++ b/solr/core/src/test/org/apache/solr/schema/TestSchemaManager.java @@ -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 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)); + } }