diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests.db/CDO Performance Tests (H2 non-audit).launch | 16 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java | 35 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTests.java | 25 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTestsMemStore.java | 52 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java (renamed from plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeleteRandomTest.java) | 31 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java | 20 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java | 6 |
7 files changed, 156 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/CDO Performance Tests (H2 non-audit).launch b/plugins/org.eclipse.emf.cdo.tests.db/CDO Performance Tests (H2 non-audit).launch new file mode 100644 index 0000000000..c298a87ed8 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.db/CDO Performance Tests (H2 non-audit).launch @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.cdo.tests.db.performance.AllPerformanceTestsH2NonAudit"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.cdo.tests.db"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx1024m -Dorg.eclipse.net4j.util.om.trace.disable=true"/> +</launchConfiguration> diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java new file mode 100644 index 0000000000..32b3689c3e --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/performance/AllPerformanceTestsH2NonAudit.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stefan Winkler - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.db.performance; + +import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation; +import org.eclipse.emf.cdo.tests.db.H2Config; +import org.eclipse.emf.cdo.tests.performance.AllPerformanceTests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Stefan Winkler + */ +public class AllPerformanceTestsH2NonAudit extends AllPerformanceTests +{ + public static Test suite() + { + return new AllPerformanceTestsH2NonAudit().getTestSuite(AllPerformanceTestsH2NonAudit.class.getName()); + } + + @Override + protected void initConfigSuites(TestSuite parent) + { + addScenario(parent, COMBINED, new H2Config(false, false, false, false, IDGenerationLocation.STORE), JVM, NATIVE); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTests.java index d3646bd151..d53d085bee 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTests.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTests.java @@ -17,34 +17,11 @@ import org.eclipse.emf.cdo.tests.performance.framework.PerformanceTestSuite; import java.util.List; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * @author Eike Stepper */ -public class AllPerformanceTests extends PerformanceTestSuite +public abstract class AllPerformanceTests extends PerformanceTestSuite { - public static Test suite() - { - return new AllPerformanceTests().getTestSuite(AllPerformanceTests.class.getName()); - } - - @Override - protected void initConfigSuites(TestSuite parent) - { - addScenario(parent, COMBINED, MEM, JVM, NATIVE); - addScenario(parent, COMBINED, MEM_AUDITS, JVM, NATIVE); - addScenario(parent, COMBINED, MEM_BRANCHES, JVM, NATIVE); - addScenario(parent, COMBINED, MEM_BRANCHES_UUIDS, JVM, NATIVE); - - addScenario(parent, COMBINED, MEM, JVM, LEGACY); - addScenario(parent, COMBINED, MEM_AUDITS, JVM, LEGACY); - addScenario(parent, COMBINED, MEM_BRANCHES, JVM, LEGACY); - - addScenario(parent, COMBINED, MEM_BRANCHES, TCP, NATIVE); - } - @Override protected void initTestClasses(List<Class<? extends ConfigTest>> testClasses, IScenario scenario) { diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTestsMemStore.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTestsMemStore.java new file mode 100644 index 0000000000..706fa30186 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/AllPerformanceTestsMemStore.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Eike Stepper - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.performance; + +import org.eclipse.emf.cdo.tests.bundle.OM; +import org.eclipse.emf.cdo.tests.config.IScenario; +import org.eclipse.emf.cdo.tests.config.impl.ConfigTest; + +import java.util.List; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Eike Stepper + */ +public class AllPerformanceTestsMemStore extends AllPerformanceTests +{ + public static Test suite() + { + return new AllPerformanceTestsMemStore().getTestSuite(AllPerformanceTestsMemStore.class.getName()); + } + + @Override + protected void initConfigSuites(TestSuite parent) + { + addScenario(parent, COMBINED, MEM, JVM, NATIVE); + addScenario(parent, COMBINED, MEM_AUDITS, JVM, NATIVE); + addScenario(parent, COMBINED, MEM_BRANCHES, JVM, NATIVE); + addScenario(parent, COMBINED, MEM_BRANCHES_UUIDS, JVM, NATIVE); + + addScenario(parent, COMBINED, MEM, JVM, LEGACY); + addScenario(parent, COMBINED, MEM_AUDITS, JVM, LEGACY); + addScenario(parent, COMBINED, MEM_BRANCHES, JVM, LEGACY); + + addScenario(parent, COMBINED, MEM_BRANCHES, TCP, NATIVE); + } + + @Override + protected void initTestClasses(List<Class<? extends ConfigTest>> testClasses, IScenario scenario) + { + testClasses.addAll(getTestClasses(OM.BUNDLE, "org.eclipse.emf.cdo.tests.performance")); + } +} diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeleteRandomTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java index b83eb8d975..4e053e412a 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeleteRandomTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/DeletePerformanceTest.java @@ -24,7 +24,7 @@ import java.util.Random; /** * @author Stefan Winkler */ -public class DeleteRandomTest extends PerformanceTest +public class DeletePerformanceTest extends PerformanceTest { private static final int AMOUNT_ELEMENTS = 10000; @@ -32,6 +32,7 @@ public class DeleteRandomTest extends PerformanceTest private Company initModel() throws CommitException { + msg("Initializing model ..."); CDOSession session = openSession(); CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.createResource(getResourcePath("res")); @@ -46,16 +47,21 @@ public class DeleteRandomTest extends PerformanceTest } resource.getContents().add(company); + msg("Committing model ..."); transaction.commit(); + msg("Done."); return company; } - public void test() throws Exception + @CleanRepositoriesBefore + public void testDeleteRandom() throws Exception { Company company = initModel(); CDOTransaction transaction = (CDOTransaction)CDOUtil.getCDOObject(company).cdoView(); + msg("Starting to remove elements ..."); + for (int i = 0; i < AMOUNT_ELEMENTS / 2; i++) { int currentSize = AMOUNT_ELEMENTS - i; @@ -68,4 +74,25 @@ public class DeleteRandomTest extends PerformanceTest stopProbing(); } } + + @CleanRepositoriesBefore + public void testDeleteDeterministic() throws Exception + { + Company company = initModel(); + CDOTransaction transaction = (CDOTransaction)CDOUtil.getCDOObject(company).cdoView(); + + msg("Starting to remove elements ..."); + + for (int i = 0; i < AMOUNT_ELEMENTS / 2; i++) + { + int indexToRemove = AMOUNT_ELEMENTS / 2 - i; + + company.getCategories().remove(indexToRemove); + + startProbing(); + transaction.commit(); + stopProbing(); + } + } + } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java index 154bb0b514..79d2773adc 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PerformanceRecord.java @@ -68,4 +68,24 @@ public class PerformanceRecord {
return getDurationSum() / probes.length;
}
+
+ public long getDurationMin()
+ {
+ long durationMin = Long.MAX_VALUE;
+ for (long probe : probes)
+ {
+ durationMin = Math.min(durationMin, probe);
+ }
+ return durationMin;
+ }
+
+ public long getDurationMax()
+ {
+ long durationMax = Long.MIN_VALUE;
+ for (long probe : probes)
+ {
+ durationMax = Math.max(durationMax, probe);
+ }
+ return durationMax;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java index 28486e0855..651929c656 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/performance/framework/PrintStreamPerformanceRecordAnalyzer.java @@ -55,7 +55,7 @@ public class PrintStreamPerformanceRecordAnalyzer implements IPerformanceRecordA "Test name", // "Test Case Name", // "Average Duration"); - + out.println(recordString); } @@ -63,14 +63,14 @@ public class PrintStreamPerformanceRecordAnalyzer implements IPerformanceRecordA { IScenario scenario = performanceRecord.getScenario(); - String recordString = MessageFormat.format("{0};{1};{2};{3};{4};{5};{6}", // + String recordString = MessageFormat.format("{0};{1};{2};{3};{4};{5};{6};{7};{8}", // scenario.getContainerConfig().getName(), // scenario.getRepositoryConfig().getName(), // scenario.getSessionConfig().getName(), // scenario.getModelConfig().getName(), // performanceRecord.getTestName(), // performanceRecord.getTestCaseName(), // - performanceRecord.getDurationAvg()); + performanceRecord.getDurationAvg(), performanceRecord.getDurationMin(), performanceRecord.getDurationMax()); out.println(recordString); } |