diff --git a/pom.xml b/pom.xml index 67d94dc951904cd60477106a55aa8ef68b6d9226..5a2b1e31742470c321c33b60b4d4b6a1b79e1543 100644 --- a/pom.xml +++ b/pom.xml @@ -33,11 +33,13 @@ <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> <version>1.3</version> + <scope>test</scope> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-library</artifactId> <version>1.3</version> + <scope>test</scope> </dependency> <dependency> <groupId>net.kieker-monitoring</groupId> @@ -53,11 +55,13 @@ <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.1.2</version> + <scope>runtime</scope> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>2.3.6</version> + <scope>runtime</scope> </dependency> <dependency> <groupId>com.google.guava</groupId> @@ -79,12 +83,19 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>versions-maven-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> @@ -97,7 +108,7 @@ </execution> </executions> <configuration> - <finalName>uber-${artifactId}-${version}</finalName> + <finalName>${project.artifactId}-${project.version}</finalName> </configuration> </plugin> </plugins> diff --git a/src/main/java/experiment/Experiment1.java b/src/main/java/experiment/Experiment1.java index ef49b2c03a9f1d1149834397b8d7bf30c10b1804..8793f7d0dc37ca90226294f03b909add8b241ee9 100644 --- a/src/main/java/experiment/Experiment1.java +++ b/src/main/java/experiment/Experiment1.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Callable; -import teetime.util.StatisticsUtil; import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; import teetime.variant.explicitScheduling.framework.core.Analysis; @@ -33,6 +32,7 @@ import teetime.variant.explicitScheduling.framework.core.Pipeline; import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; import teetime.variant.explicitScheduling.stage.NoopFilter; +import util.StatisticsUtil; import kieker.analysis.AnalysisController; import kieker.analysis.IAnalysisController; diff --git a/src/main/java/experiment/Experiment2.java b/src/main/java/experiment/Experiment2.java index 13c08fc89a9eef1b063c63ef1c394362557a544a..8f48855855ed772dfa68ebf41f9c730fa423924f 100644 --- a/src/main/java/experiment/Experiment2.java +++ b/src/main/java/experiment/Experiment2.java @@ -34,7 +34,6 @@ import kieker.analysis.stage.StartTimestampFilter; import kieker.analysis.stage.StopTimestampFilter; import kieker.common.configuration.Configuration; -import teetime.util.StatisticsUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; import teetime.variant.explicitScheduling.framework.core.Analysis; @@ -43,6 +42,7 @@ import teetime.variant.explicitScheduling.framework.core.Pipeline; import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; import teetime.variant.explicitScheduling.stage.NoopFilter; +import util.StatisticsUtil; /** * @author Nils Christian Ehmke diff --git a/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java b/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java index e4177ad83a6c9ad536e3bafd66906ca3b9dc9750..3bbd1bb93ddd491fd19548dd1e72b9c90f3c4335 100644 --- a/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java +++ b/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java @@ -21,10 +21,10 @@ import java.util.concurrent.Callable; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; +import util.StatisticsUtil; import kieker.analysis.examples.ThroughputTimestampAnalysis; import kieker.analysis.exception.AnalysisConfigurationException; diff --git a/src/test/java/teetime/util/StopWatchTest.java b/src/test/java/teetime/util/StopWatchTest.java index d61450e94cae54200a9600e5c47497f6620958a5..6ecf46a044916001a12de21e3c606b40ef4e89d9 100644 --- a/src/test/java/teetime/util/StopWatchTest.java +++ b/src/test/java/teetime/util/StopWatchTest.java @@ -7,6 +7,8 @@ import java.util.Map; import org.junit.Test; +import util.StatisticsUtil; + public class StopWatchTest { private static final int NUM_ITERATIONS = 1000000; diff --git a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java index 677abf645370849ea396ced8973c0cd5b70c7679..d4fb3f2d1c56de010f7888d7363a97f6e53a96f4 100644 --- a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java +++ b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java @@ -20,7 +20,7 @@ import java.util.concurrent.Callable; import org.junit.Test; import teetime.util.StopWatch; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java index df3054665485d7864469b18e60a96311c2e96d86..d6a3a39387720f101649e70875e3ba8b21c3b06a 100644 --- a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java +++ b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java @@ -21,9 +21,9 @@ import java.util.concurrent.Callable; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; -import test.PerformanceTest; +import util.PerformanceTest; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java b/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java index 4c4079879376728a0af638d27fc960440282dd90..084b8f39a9209f9e607b0f8bab25f22f07499219 100644 --- a/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java +++ b/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java @@ -20,8 +20,8 @@ import teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimes import teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test; import teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test; import teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test; -import test.PerformanceResult; -import test.PerformanceTest; +import util.PerformanceResult; +import util.PerformanceTest; @RunWith(Suite.class) @SuiteClasses({ diff --git a/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java b/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java index c4ac6dc7450a324201b9c233c3532a02f9a06762..ba1ff285e143a6ec2a4be1b941b940c3d5d3c6d9 100644 --- a/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java +++ b/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java @@ -20,8 +20,8 @@ import teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimes import teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test; import teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test; import teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test; -import test.PerformanceResult; -import test.PerformanceTest; +import util.PerformanceResult; +import util.PerformanceTest; @RunWith(Suite.class) @SuiteClasses({ diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java index 8c6362baed596483242ccb306760083dfad3401a..45a41b5c50fe6d764ff6c992e72cf410a7eb14d1 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java @@ -20,10 +20,10 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.util.StatisticsUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceResult; -import test.PerformanceTest; +import util.PerformanceResult; +import util.PerformanceTest; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java index 20da6308b0d28b60d623d267f3a84a07b9b74e80..a8f7c0012a8d87ffa1a43528bc8c7f2f3de7f054 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java index 0bfc8205242b935b6bd8c0dfe99433910761d2cc..f0254708c07660dcafabade22626179cb7930cba 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java index ba5f80958544c78d5be12f3ca4ee490674443925..bc5b0ea55f127de455d2fcf8448d7e5d095ffbc6 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java index 22c2ec2bbf9f8d6e8dc89ab8bf87de105dcb87c2..6922fc2a8d346cfc192a2c688c979518ef73b574 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java index fa2150df78a88f01344bb24eaa2257c89adc9d08..7971dfa4a4a12a644238db0fbc79f2830021d084 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java index 7ced7c151c8b57d85aae9cff88a3678fb9319c33..77249c1d270bf8ef6280bf612ed14b6146a90ca4 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java index e2de139f3433d905100410c3c699c44ed8e3b69d..c46ae4e173f7512a81ad97db5164c4d7e4b79f26 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java index 86e662f9ce0501b4af2e4e69dbc0ef832e6b4d5a..61207a67726dfbe45673f88200f8f7d407444c0e 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java index 246a968a7d3297c49e6725bb6130dd3c6066125a..d0d50d5b128387179c012d5815a7b52f191a5b37 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java +++ b/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java new file mode 100644 index 0000000000000000000000000000000000000000..28b2bb3fd6b02fad9aa186dcdce23640752f56f6 --- /dev/null +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java @@ -0,0 +1,116 @@ +package teetime.variant.methodcallWithPorts.examples; + +import static org.junit.Assert.assertEquals; + +import java.util.Map; +import java.util.Map.Entry; + +import util.PerformanceCheckProfile; +import util.PerformanceResult; +import util.PerformanceTest; + +public class ChwHomeComparisonMethodcallWithPorts implements PerformanceCheckProfile { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwHome"; + } + + @Override + public void check() { + Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; + for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { + System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); + } + + PerformanceResult test1 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test9 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test)"); + PerformanceResult test10 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); + PerformanceResult test11 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); + PerformanceResult test14 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test)"); + PerformanceResult test15 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); + PerformanceResult test16a = performanceResults + .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16b = performanceResults + .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16c = performanceResults + .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test17 = performanceResults + .get("testWithManyObjects(teetime.variant.methodcallWithPorts.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test)"); + PerformanceResult test19a = performanceResults + .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); + PerformanceResult test19b = performanceResults + .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); + PerformanceResult test19c = performanceResults + .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); + + double value14 = (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5); + double value10 = (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5); + double value11 = (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5); + double value9 = (double) test9.quantiles.get(0.5) / test1.quantiles.get(0.5); + double value15 = (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5); + double value17 = (double) test17.quantiles.get(0.5) / test1.quantiles.get(0.5); + + System.out.println("value14: " + value14); + System.out.println("value10: " + value10); + System.out.println("value11: " + value11); + System.out.println("value9: " + value9); + System.out.println("value15: " + value15); + System.out.println("value17: " + value17); + + // until 25.06.2014 (incl.) + // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // assertEquals(14, (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); + // assertEquals(32, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); + // assertEquals(22, (double) test9.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); + // assertEquals(44, (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); + // assertEquals(39, (double) test17.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); + + // since 26.06.2014 (incl.) + // assertEquals(76, value14, 5.1); // +16 + // assertEquals(26, value10, 2.1); // +14 + // assertEquals(44, value11, 4.1); // +12 + // assertEquals(36, value9, 2.1); // +14 + // assertEquals(44, value15, 4.1); // +0 + // assertEquals(53, value17, 4.1); // +14 + + // // since 04.07.2014 (incl.) + // assertEquals(86, value14, 5.1); // +16 + // assertEquals(26, value10, 2.1); // +0 + // assertEquals(41, value11, 4.1); // -3 + // assertEquals(42, value9, 2.1); // +6 + // assertEquals(44, value15, 4.1); // +0 + // assertEquals(53, value17, 4.1); // +0 + + // since 11.08.2014 (incl.) + assertEquals(103, value14, 5.1); // +17 + assertEquals(47, value10, 2.1); // +21 + assertEquals(41, value11, 4.1); // -3 + assertEquals(42, value9, 2.1); // +6 + assertEquals(44, value15, 4.1); // +0 + assertEquals(53, value17, 4.1); // +0 + + // below results vary too much, possibly due to the OS' scheduler + // assertEquals(RESULT_TESTS_16, (double) test16a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // assertEquals(RESULT_TESTS_16, (double) test16b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // assertEquals(RESULT_TESTS_16, (double) test16c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // + // assertEquals(RESULT_TESTS_19, (double) test19a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // assertEquals(RESULT_TESTS_19, (double) test19b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // assertEquals(RESULT_TESTS_19, (double) test19c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + + // check speedup + assertEquals(2, (double) test16a.overallDurationInNs / test16b.overallDurationInNs, 0.3); + assertEquals(2.5, (double) test16a.overallDurationInNs / test16c.overallDurationInNs, 0.2); + + assertEquals(2, (double) test19a.overallDurationInNs / test19b.overallDurationInNs, 0.3); + assertEquals(2.5, (double) test19a.overallDurationInNs / test19c.overallDurationInNs, 0.3); + } + +} diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwComparisonMethodcallWithPorts.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java similarity index 75% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/ChwComparisonMethodcallWithPorts.java rename to src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java index b44a916dd1c902147697f356a28b158cb54d2f1a..3ef1f995c6f9e91cc0d902cc0dab40a3b4e873b3 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java @@ -5,42 +5,19 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; -import org.junit.AfterClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.variant.methodcallWithPorts.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; -import teetime.variant.methodcallWithPorts.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; -import teetime.variant.methodcallWithPorts.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; -import teetime.variant.methodcallWithPorts.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test; -import teetime.variant.methodcallWithPorts.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; -import teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; -import teetime.variant.methodcallWithPorts.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; -import teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; -import test.PerformanceResult; -import test.PerformanceTest; - -@RunWith(Suite.class) -@SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, - MethodCallThoughputTimestampAnalysis9Test.class, - MethodCallThoughputTimestampAnalysis10Test.class, - MethodCallThoughputTimestampAnalysis11Test.class, - MethodCallThoughputTimestampAnalysis14Test.class, - MethodCallThoughputTimestampAnalysis15Test.class, - MethodCallThoughputTimestampAnalysis16Test.class, - MethodCallThoughputTimestampAnalysis17Test.class, - MethodCallThoughputTimestampAnalysis19Test.class, -}) -public class ChwComparisonMethodcallWithPorts { - - private static final double RESULT_TESTS_16 = 30; - private static final double RESULT_TESTS_19 = 70; - - @AfterClass - public static void compareResults() { +import util.PerformanceCheckProfile; +import util.PerformanceResult; +import util.PerformanceTest; + +public class ChwWorkComparisonMethodcallWithPorts implements PerformanceCheckProfile { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwWork"; + } + + @Override + public void check() { Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java new file mode 100644 index 0000000000000000000000000000000000000000..c2a142e7ca388d622fb4c401f70a4630f40b6393 --- /dev/null +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java @@ -0,0 +1,48 @@ +package teetime.variant.methodcallWithPorts.examples; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; +import teetime.variant.methodcallWithPorts.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; +import teetime.variant.methodcallWithPorts.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; +import teetime.variant.methodcallWithPorts.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; +import teetime.variant.methodcallWithPorts.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test; +import teetime.variant.methodcallWithPorts.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; +import teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; +import teetime.variant.methodcallWithPorts.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; +import teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; +import util.PerformanceCheckProfile; +import util.PerformanceCheckProfileRepository; + +@RunWith(Suite.class) +@SuiteClasses({ + MethodCallThoughputTimestampAnalysis1Test.class, + MethodCallThoughputTimestampAnalysis9Test.class, + MethodCallThoughputTimestampAnalysis10Test.class, + MethodCallThoughputTimestampAnalysis11Test.class, + MethodCallThoughputTimestampAnalysis14Test.class, + MethodCallThoughputTimestampAnalysis15Test.class, + MethodCallThoughputTimestampAnalysis16Test.class, + MethodCallThoughputTimestampAnalysis17Test.class, + MethodCallThoughputTimestampAnalysis19Test.class, +}) +public class ComparisonMethodcallWithPorts { + + @BeforeClass + public static void beforeClass() { + PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new ChwWorkComparisonMethodcallWithPorts()); + PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new ChwHomeComparisonMethodcallWithPorts()); + PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new NieWorkComparisonMethodcallWithPorts()); + }; + + @AfterClass + public static void compareResults() { + PerformanceCheckProfile pcp = PerformanceCheckProfileRepository.INSTANCE.get(ComparisonMethodcallWithPorts.class); + pcp.check(); + } + +} diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/NieComparisonMethodcallWithPorts.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java similarity index 70% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/NieComparisonMethodcallWithPorts.java rename to src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java index 94028b1acf57dfd3a7c646d8c342bdc8368cb7b0..73472fee98069cf42a5be85f024294641b3966e0 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/NieComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java @@ -5,42 +5,19 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; -import org.junit.AfterClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; +import util.PerformanceCheckProfile; +import util.PerformanceResult; +import util.PerformanceTest; -import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.variant.methodcallWithPorts.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; -import teetime.variant.methodcallWithPorts.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; -import teetime.variant.methodcallWithPorts.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; -import teetime.variant.methodcallWithPorts.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test; -import teetime.variant.methodcallWithPorts.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; -import teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; -import teetime.variant.methodcallWithPorts.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; -import teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; -import test.PerformanceResult; -import test.PerformanceTest; +public class NieWorkComparisonMethodcallWithPorts implements PerformanceCheckProfile { -@RunWith(Suite.class) -@SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, - MethodCallThoughputTimestampAnalysis9Test.class, - MethodCallThoughputTimestampAnalysis10Test.class, - MethodCallThoughputTimestampAnalysis11Test.class, - MethodCallThoughputTimestampAnalysis14Test.class, - MethodCallThoughputTimestampAnalysis15Test.class, - MethodCallThoughputTimestampAnalysis16Test.class, - MethodCallThoughputTimestampAnalysis17Test.class, - MethodCallThoughputTimestampAnalysis19Test.class, -}) -public class NieComparisonMethodcallWithPorts { - - private static final double RESULT_TESTS_16 = 30; - private static final double RESULT_TESTS_19 = 70; + @Override + public String getCorrespondingPerformanceProfile() { + return "NieWork"; + } - @AfterClass - public static void compareResults() { + @Override + public void check() { Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java index ba57740c74ceaa10f8ef7470708aabed4a0f7b4b..b6f0f532f4e9067370cea3aedefff4ddffcbfe4d 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java index 0024fa18e9621e0bc930afffac660a13146bdc02..14858bc3d2ceb70bb292e99b2b17587fe57bcc08 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java index c9dc1645f3f22bbd6ae5f4aa203d0a54f58849b1..1b225360272d279d0bded0fc423fbf8d60127f48 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java index 6a49130a55995e59d6e5408ae653e5c05226966a..e32ecf51c062a151f232a4f05020dcc233e39e36 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java index d6a5f58602343fe138213f4f19ff7673a25bfbfa..bf350f0c011c830f4fcc708035e0cdb2686bb626 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..a924a70d6d2a243fe6ac0bdd8709370d0adb6ae3 --- /dev/null +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java @@ -0,0 +1,33 @@ +package teetime.variant.methodcallWithPorts.examples.experiment16; + +import static org.junit.Assert.assertEquals; +import util.PerformanceCheckProfile; +import util.PerformanceResult; +import util.PerformanceTest; + +public class ChwHomePerformanceCheck implements PerformanceCheckProfile { + + @Override + public void check() { + PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + // check speedup + double speedupB = (double) test16a.overallDurationInNs / test16b.overallDurationInNs; + double speedupC = (double) test16a.overallDurationInNs / test16c.overallDurationInNs; + + System.out.println("speedupB: " + speedupB); + System.out.println("speedupC: " + speedupC); + + assertEquals(2, speedupB, 0.3); + assertEquals(3, speedupC, 0.3); + } + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwHome"; + } +} diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..c60b62627abc4b2ae60b2b8c3c1f60515ce90bad --- /dev/null +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java @@ -0,0 +1,33 @@ +package teetime.variant.methodcallWithPorts.examples.experiment16; + +import static org.junit.Assert.assertEquals; +import util.PerformanceCheckProfile; +import util.PerformanceResult; +import util.PerformanceTest; + +public class ChwWorkPerformanceCheck implements PerformanceCheckProfile { + + @Override + public void check() { + PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); + // check speedup + double speedupB = (double) test16a.overallDurationInNs / test16b.overallDurationInNs; + double speedupC = (double) test16a.overallDurationInNs / test16c.overallDurationInNs; + + System.out.println("speedupB: " + speedupB); + System.out.println("speedupC: " + speedupC); + + assertEquals(2, speedupB, 0.3); + assertEquals(2.5, speedupC, 0.3); + } + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwWork"; + } +} diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java index 13dd2e8e54d6bf1eaf551096a0b79cbf98ce38b0..46147ec38df84508d6440852c58884a0fafcb861 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java @@ -15,9 +15,8 @@ ***************************************************************************/ package teetime.variant.methodcallWithPorts.examples.experiment16; -import static org.junit.Assert.assertEquals; - import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @@ -25,12 +24,13 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceResult; -import test.PerformanceTest; +import util.PerformanceCheckProfile; +import util.PerformanceCheckProfileRepository; +import util.PerformanceTest; /** * @author Christian Wulf - * + * * @since 1.10 */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -38,6 +38,12 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest // TODO use @Parameter for the number of threads + @BeforeClass + public static void beforeClass() { + PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwWorkPerformanceCheck()); + PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwHomePerformanceCheck()); + }; + @Test public void testWithManyObjectsAnd1Thread() { this.performAnalysis(1); @@ -55,21 +61,8 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest @AfterClass public static void afterClass() { - PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - // check speedup - double speedupB = (double) test16a.overallDurationInNs / test16b.overallDurationInNs; - double speedupC = (double) test16a.overallDurationInNs / test16c.overallDurationInNs; - - System.out.println("speedupB: " + speedupB); - System.out.println("speedupC: " + speedupC); - - assertEquals(2, speedupB, 0.3); - assertEquals(2.5, speedupC, 0.3); + PerformanceCheckProfile pcp = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis16Test.class); + pcp.check(); } private void performAnalysis(final int numThreads) { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java index 869f09b96f25a704a670e7ba40ea324fec7343b5..804a930d90ddf70e88088a01adde9e49cf8a4737 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java @@ -20,7 +20,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java index 25f19d8ab4d1bd7fc400c09520e3586cc1d2bb81..03951f82c05a7173d411117db521d2dd273ce2e8 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java @@ -22,7 +22,7 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceTest; +import util.PerformanceTest; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TimingsReader.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TimingsReader.java index 232b7ff9fe104176238fe8463877d72fcd5a3f7b..1b55697fcda0bce9a18b34b76be46699309c8001 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TimingsReader.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TimingsReader.java @@ -6,7 +6,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import teetime.util.StatisticsUtil; +import util.StatisticsUtil; import com.google.common.base.Charsets; import com.google.common.collect.ImmutableList; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java index d21667dc78209871735699860cb45845cd35435f..b0b1a7b471bb9f3ab27d74506ce6723dd7d68d8c 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java @@ -33,8 +33,8 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import teetime.util.ListUtil; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java index 25cbe39a8b83a457800a97620d1a32b962fdbf99..f78436fc42cbfba8d1cf00b43067549536b0e458 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java @@ -31,8 +31,8 @@ import org.junit.Before; import org.junit.Test; import teetime.util.ListUtil; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java index 670435766e2083bbcd69e9fae9161e7170a786c3..dd361ea70b7c220ee4ef8ac6a0385fabdd6d6397 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java @@ -30,8 +30,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java index 938825539ecdb0e7ff5d8d6d7d8a7e2d0817334c..48658d2f5771652241b7e58ecd5ebce57f1991dd 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java @@ -24,8 +24,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java index 5e112cd7e1c924449cbba81f6f328badc8be3f8a..c123e24eb84137e72435075e1b915e0fcf52252f 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java @@ -30,8 +30,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java index d50794c36658d37072ccc24e0cb236768a7af2fc..dd4c3064d462f0996072d4a7c65d2cac72d59724 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java @@ -30,8 +30,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java index 77025f2291d6bfaa92b54dc95af7c7f1e5aa82d9..de3ac414017f35525cd7f6f28c4248ba2474a036 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -33,10 +33,10 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import teetime.util.ListUtil; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; import teetime.variant.methodcallWithPorts.framework.core.Analysis; import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; +import util.StatisticsUtil; import kieker.common.record.IMonitoringRecord; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java index dd066a91985e8a22d8a63016550b95636831df8f..800b29b228ab32db4140af38be8d7aca9a43ddfe 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -28,10 +28,10 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import teetime.util.ListUtil; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; import teetime.variant.methodcallWithPorts.framework.core.Analysis; import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; +import util.StatisticsUtil; import kieker.common.record.IMonitoringRecord; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java index d5bd3c9c9e4560814ef987dcf6bf9cdd7ac50fbd..11aaa5b67eeaa9264d08ef8d24b493bfabed4d67 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java @@ -28,8 +28,8 @@ import org.junit.Test; import org.junit.runners.MethodSorters; import teetime.util.ListUtil; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; +import util.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/test/java/test/MeasurementRepository.java b/src/test/java/util/MeasurementRepository.java similarity index 93% rename from src/test/java/test/MeasurementRepository.java rename to src/test/java/util/MeasurementRepository.java index 03d1219a547f1b837b780c349f29df97550c01e7..c970174d5e831e243502b3c730e0937d2187e3ce 100644 --- a/src/test/java/test/MeasurementRepository.java +++ b/src/test/java/util/MeasurementRepository.java @@ -1,4 +1,4 @@ -package test; +package util; import java.util.HashMap; import java.util.Map; diff --git a/src/test/java/util/PerformanceCheckProfile.java b/src/test/java/util/PerformanceCheckProfile.java new file mode 100644 index 0000000000000000000000000000000000000000..4fd7155694f3af58d3a7273be60c579f39468781 --- /dev/null +++ b/src/test/java/util/PerformanceCheckProfile.java @@ -0,0 +1,9 @@ +package util; + +public interface PerformanceCheckProfile { + + String getCorrespondingPerformanceProfile(); + + void check(); + +} diff --git a/src/test/java/util/PerformanceCheckProfileRepository.java b/src/test/java/util/PerformanceCheckProfileRepository.java new file mode 100644 index 0000000000000000000000000000000000000000..d5941015a7f064aa484fc9f38c31de2b47ccf7ca --- /dev/null +++ b/src/test/java/util/PerformanceCheckProfileRepository.java @@ -0,0 +1,35 @@ +package util; + +import java.util.HashMap; +import java.util.Map; + +public class PerformanceCheckProfileRepository { + + public static final PerformanceCheckProfileRepository INSTANCE = new PerformanceCheckProfileRepository(); + + private final Map<Class<?>, PerformanceCheckProfile> performanceCheckProfiles = new HashMap<Class<?>, PerformanceCheckProfile>(); + + private String currentProfile; + + public PerformanceCheckProfileRepository() { + this.currentProfile = System.getProperty("TestProfile", "ChwWork"); + } + + public void setCurrentProfile(final String currentProfile) { + this.currentProfile = currentProfile; + } + + public String getCurrentProfile() { + return this.currentProfile; + } + + public void register(final Class<?> testClass, final PerformanceCheckProfile profile) { + if (profile.getCorrespondingPerformanceProfile().equals(this.currentProfile)) { + this.performanceCheckProfiles.put(testClass, profile); + } + } + + public PerformanceCheckProfile get(final Class<?> clazz) { + return this.performanceCheckProfiles.get(clazz); + } +} diff --git a/src/test/java/test/PerformanceResult.java b/src/test/java/util/PerformanceResult.java similarity index 94% rename from src/test/java/test/PerformanceResult.java rename to src/test/java/util/PerformanceResult.java index e950ea40c759cff850541315a5ef6a8090d763c7..36c82832a1b7e0f22ddc2f25bcd6b27adb2aa6ad 100644 --- a/src/test/java/test/PerformanceResult.java +++ b/src/test/java/util/PerformanceResult.java @@ -1,9 +1,7 @@ -package test; +package util; import java.util.Map; -import teetime.util.StatisticsUtil; - public class PerformanceResult { public long overallDurationInNs; diff --git a/src/test/java/test/PerformanceTest.java b/src/test/java/util/PerformanceTest.java similarity index 97% rename from src/test/java/test/PerformanceTest.java rename to src/test/java/util/PerformanceTest.java index 5d74b846a0790962037ae979b3193d0a0a5424fd..b85aacc4e57c268ff29b142313a48bab42e4aa57 100644 --- a/src/test/java/test/PerformanceTest.java +++ b/src/test/java/util/PerformanceTest.java @@ -1,4 +1,4 @@ -package test; +package util; import java.util.ArrayList; import java.util.List; @@ -11,7 +11,6 @@ import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runner.Description; -import teetime.util.StatisticsUtil; import teetime.util.StopWatch; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; diff --git a/src/main/java/teetime/util/StatisticsUtil.java b/src/test/java/util/StatisticsUtil.java similarity index 98% rename from src/main/java/teetime/util/StatisticsUtil.java rename to src/test/java/util/StatisticsUtil.java index a5120bba7478b03daa2dd41866b88cfe523ae629..1891546118ea50f4a9f1b719e72b24659c095542 100644 --- a/src/main/java/teetime/util/StatisticsUtil.java +++ b/src/test/java/util/StatisticsUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.util; +package util; import java.util.ArrayList; import java.util.Collections; @@ -24,8 +24,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import teetime.util.MathUtil; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import test.PerformanceResult; /** * @author Christian Wulf