diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 29abf999564110a0d6aca109f55f439c72b7031c..989609020a008e70c15d3ce12a3a1c835b80201c 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,6 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 encoding//src/test/resources=UTF-8 encoding/<project>=UTF-8 diff --git a/src/main/java/teetime/stage/NoopFilter.java b/src/main/java/teetime/stage/NoopFilter.java index 4a7211520fa5d367629631257011f1bce65cdbfd..aaef5e797a0f107cd4d627613fcca38f171d01fd 100644 --- a/src/main/java/teetime/stage/NoopFilter.java +++ b/src/main/java/teetime/stage/NoopFilter.java @@ -20,7 +20,7 @@ import teetime.framework.OutputPort; /** * @author Christian Wulf - * + * * @since 1.10 */ public class NoopFilter<T> extends ConsumerStage<T> { diff --git a/src/main/java/util/BucketTimingsReader.java b/src/main/java/util/BucketTimingsReader.java index a857bd3671ae0c2876cbf143c53dc9ab693ac067..911c997bc391d6337a44fade8c04b75c3134a89f 100644 --- a/src/main/java/util/BucketTimingsReader.java +++ b/src/main/java/util/BucketTimingsReader.java @@ -11,6 +11,8 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import util.test.StatisticsUtil; + import com.google.common.base.Charsets; import com.google.common.io.CharSource; import com.google.common.io.Files; diff --git a/src/main/java/util/PerformanceCheckProfile.java b/src/main/java/util/PerformanceCheckProfile.java deleted file mode 100644 index 4fd7155694f3af58d3a7273be60c579f39468781..0000000000000000000000000000000000000000 --- a/src/main/java/util/PerformanceCheckProfile.java +++ /dev/null @@ -1,9 +0,0 @@ -package util; - -public interface PerformanceCheckProfile { - - String getCorrespondingPerformanceProfile(); - - void check(); - -} diff --git a/src/main/java/util/MeasurementRepository.java b/src/main/java/util/test/MeasurementRepository.java similarity index 91% rename from src/main/java/util/MeasurementRepository.java rename to src/main/java/util/test/MeasurementRepository.java index c970174d5e831e243502b3c730e0937d2187e3ce..d510c78520e59ae106b7ec77a6f8ca71d942e911 100644 --- a/src/main/java/util/MeasurementRepository.java +++ b/src/main/java/util/test/MeasurementRepository.java @@ -1,4 +1,4 @@ -package util; +package util.test; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/util/PerformanceCheckProfileRepository.java b/src/main/java/util/test/PerformanceCheckProfileRepository.java similarity index 75% rename from src/main/java/util/PerformanceCheckProfileRepository.java rename to src/main/java/util/test/PerformanceCheckProfileRepository.java index 066fdeb662d419bb21aca3bfa253707eadbf7caa..74b8ad37ec6b6e709fbf4c8fe972b60a565988f6 100644 --- a/src/main/java/util/PerformanceCheckProfileRepository.java +++ b/src/main/java/util/test/PerformanceCheckProfileRepository.java @@ -1,4 +1,4 @@ -package util; +package util.test; import java.util.HashMap; import java.util.Map; @@ -12,7 +12,7 @@ public class PerformanceCheckProfileRepository { public static final PerformanceCheckProfileRepository INSTANCE = new PerformanceCheckProfileRepository(); - private final Map<Class<?>, PerformanceCheckProfile> performanceCheckProfiles = new HashMap<Class<?>, PerformanceCheckProfile>(); + private final Map<Class<?>, ProfiledPerformanceAssertion> performanceCheckProfiles = new HashMap<Class<?>, ProfiledPerformanceAssertion>(); private String currentProfile; @@ -29,13 +29,13 @@ public class PerformanceCheckProfileRepository { return this.currentProfile; } - public void register(final Class<?> testClass, final PerformanceCheckProfile profile) { + public void register(final Class<?> testClass, final ProfiledPerformanceAssertion profile) { if (profile.getCorrespondingPerformanceProfile().equals(this.currentProfile)) { this.performanceCheckProfiles.put(testClass, profile); } } - public PerformanceCheckProfile get(final Class<?> clazz) { + public ProfiledPerformanceAssertion get(final Class<?> clazz) { return this.performanceCheckProfiles.get(clazz); } } diff --git a/src/main/java/util/PerformanceResult.java b/src/main/java/util/test/PerformanceResult.java similarity index 97% rename from src/main/java/util/PerformanceResult.java rename to src/main/java/util/test/PerformanceResult.java index 36c82832a1b7e0f22ddc2f25bcd6b27adb2aa6ad..22cf87e3069066fc0b224de3062fa69bc4dda835 100644 --- a/src/main/java/util/PerformanceResult.java +++ b/src/main/java/util/test/PerformanceResult.java @@ -1,4 +1,4 @@ -package util; +package util.test; import java.util.Map; diff --git a/src/main/java/util/PerformanceTest.java b/src/main/java/util/test/PerformanceTest.java similarity index 92% rename from src/main/java/util/PerformanceTest.java rename to src/main/java/util/test/PerformanceTest.java index cc672d509e4890a617b19fd3a71ede5592012a49..d2f9e3ba8674e393a3460cf6731d70f7c785fc14 100644 --- a/src/main/java/util/PerformanceTest.java +++ b/src/main/java/util/test/PerformanceTest.java @@ -1,4 +1,4 @@ -package util; +package util.test; import java.util.ArrayList; import java.util.List; @@ -6,7 +6,6 @@ import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; @@ -17,6 +16,7 @@ import teetime.util.TimestampObject; public abstract class PerformanceTest { + protected static final PerformanceCheckProfileRepository PERFORMANCE_CHECK_PROFILE_REPOSITORY = PerformanceCheckProfileRepository.INSTANCE; protected static final int NUM_OBJECTS_TO_CREATE = 1000000; protected static final int NUM_NOOP_FILTERS = 800; @@ -27,8 +27,7 @@ public abstract class PerformanceTest { protected StopWatch stopWatch; protected List<TimestampObject> timestampObjects; - @BeforeClass - public static void beforeClass() { + static { System.setProperty("logback.configurationFile", "src/test/resources/logback-test.groovy"); } diff --git a/src/main/java/util/test/ProfiledPerformanceAssertion.java b/src/main/java/util/test/ProfiledPerformanceAssertion.java new file mode 100644 index 0000000000000000000000000000000000000000..88f300355d0ef137aff12d6677307939e4c529a5 --- /dev/null +++ b/src/main/java/util/test/ProfiledPerformanceAssertion.java @@ -0,0 +1,12 @@ +package util.test; + +public abstract class ProfiledPerformanceAssertion { + + public abstract String getCorrespondingPerformanceProfile(); + + public abstract void check(); + + protected String buildTestMethodIdentifier(final Class<? extends PerformanceTest> testClass, final String methodName) { + return testClass.getName() + "(" + methodName + ")"; + } +} diff --git a/src/main/java/util/StatisticsUtil.java b/src/main/java/util/test/StatisticsUtil.java similarity index 99% rename from src/main/java/util/StatisticsUtil.java rename to src/main/java/util/test/StatisticsUtil.java index 62d0d0e741072e8d51fbb8706bc796264b8c9d65..a0f091bc5a66c3788887a94143b1733bd90fa920 100644 --- a/src/main/java/util/StatisticsUtil.java +++ b/src/main/java/util/test/StatisticsUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package util; +package util.test; import java.util.ArrayList; import java.util.Collections; diff --git a/src/performancetest/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java b/src/performancetest/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java index 95d173d6d73aed4336d09ea9654be12d444429f3..2e92b7c42e38404d8691772e3cb9209723f4d55d 100644 --- a/src/performancetest/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java +++ b/src/performancetest/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java @@ -23,8 +23,8 @@ import org.junit.Test; import teetime.util.StopWatch; import teetime.util.TimestampObject; -import util.PerformanceTest; -import util.StatisticsUtil; +import util.test.PerformanceTest; +import util.test.StatisticsUtil; import kieker.analysis.examples.ThroughputTimestampAnalysis; import kieker.analysis.exception.AnalysisConfigurationException; diff --git a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java index 8c4ab937fe73bf651c0b9c9f5986601db7b4f102..52105427b358d1f6e97fc709eb0f5553283f3ac8 100644 --- a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java +++ b/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java @@ -5,11 +5,11 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwHomeComparisonMethodcallWithPorts implements PerformanceCheckProfile { +public class ChwHomeComparisonMethodcallWithPorts extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { @@ -27,12 +27,6 @@ public class ChwHomeComparisonMethodcallWithPorts implements PerformanceCheckPro .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); PerformanceResult test9 = performanceResults .get("testWithManyObjects(teetime.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test)"); - PerformanceResult test10 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); - PerformanceResult test11 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); - PerformanceResult test14 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test)"); PerformanceResult test15 = performanceResults .get("testWithManyObjects(teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); PerformanceResult test16a = performanceResults @@ -50,57 +44,36 @@ public class ChwHomeComparisonMethodcallWithPorts implements PerformanceCheckPro PerformanceResult test19c = performanceResults .get("testWithManyObjectsAnd4Threads(teetime.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("value9: " + value9); - System.out.println("value11: " + value11); - System.out.println("value10: " + value10); - System.out.println("value14: " + value14); System.out.println("value15: " + value15); System.out.println("value17: " + value17); // until 25.06.2014 (incl.) // assertEquals(22, (double) test9.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(14, (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); - // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.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(36, value9, 2.1); // +14 - // assertEquals(44, value11, 4.1); // +12 - // assertEquals(26, value10, 2.1); // +14 - // assertEquals(76, value14, 5.1); // +16 // assertEquals(44, value15, 4.1); // +0 // assertEquals(53, value17, 4.1); // +14 // // since 04.07.2014 (incl.) // assertEquals(42, value9, 2.1); // +6 - // assertEquals(41, value11, 4.1); // -3 - // assertEquals(26, value10, 2.1); // +0 - // assertEquals(86, value14, 5.1); // +16 // assertEquals(44, value15, 4.1); // +0 // assertEquals(53, value17, 4.1); // +0 // since 11.08.2014 (incl.) // assertEquals(42, value9, 2.1); // +6 - // assertEquals(41, value11, 4.1); // -3 - // assertEquals(47, value10, 2.1); // +21 - // assertEquals(103, value14, 5.1); // +17 // assertEquals(44, value15, 4.1); // +0 // assertEquals(53, value17, 4.1); // +0 // since 31.08.2014 (incl.) assertEquals(44, value9, 2.1); // ?? - assertEquals(43, value11, 4.1); // ?? - assertEquals(51, value10, 2.1); // ?? - assertEquals(62, value14, 5.1); // ?? assertEquals(68, value15, 4.1); // ?? assertEquals(75, value17, 4.1); // ?? diff --git a/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java index 7e2bf8468ab9dde7b7c16a80dbbf93fa7d6ea611..38116b72e74c17fa94ce080b1edec976167a0738 100644 --- a/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java +++ b/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java @@ -5,11 +5,11 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwWorkComparisonMethodcallWithPorts implements PerformanceCheckProfile { +public class ChwWorkComparisonMethodcallWithPorts extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { @@ -27,12 +27,8 @@ public class ChwWorkComparisonMethodcallWithPorts implements PerformanceCheckPro .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); PerformanceResult test9 = performanceResults .get("testWithManyObjects(teetime.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test)"); - PerformanceResult test10 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); PerformanceResult test11 = performanceResults .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); - PerformanceResult test14 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test)"); PerformanceResult test15 = performanceResults .get("testWithManyObjects(teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); PerformanceResult test16a = performanceResults @@ -50,48 +46,42 @@ public class ChwWorkComparisonMethodcallWithPorts implements PerformanceCheckPro PerformanceResult test19c = performanceResults .get("testWithManyObjectsAnd4Threads(teetime.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 27.08.2014 (incl.) - assertEquals(102, value14, 5.1); // +16 - assertEquals(56, value10, 2.1); // +30 - assertEquals(64, value11, 4.1); // +15 + // assertEquals(64, value11, 4.1); // +15 + // assertEquals(77, value9, 2.1); // +35 + // assertEquals(44, value15, 4.1); // +0 + // assertEquals(53, value17, 4.1); // +0 + + // since 14.10.2014 (incl.) + assertEquals(44, value11, 4.1); // -20 assertEquals(77, value9, 2.1); // +35 assertEquals(44, value15, 4.1); // +0 assertEquals(53, value17, 4.1); // +0 diff --git a/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java index 2d9876f47df99c14d14619eb079c825d393a6586..26a913942e5f85a09fbe418273b2d175a794876e 100644 --- a/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java +++ b/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java @@ -6,6 +6,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; +import teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; import teetime.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; import teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; import teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; @@ -14,12 +15,12 @@ import teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; import teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; import teetime.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; import teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; -import util.PerformanceCheckProfile; -import util.PerformanceCheckProfileRepository; +import util.test.PerformanceCheckProfileRepository; +import util.test.ProfiledPerformanceAssertion; @RunWith(Suite.class) @SuiteClasses({ - // MethodCallThoughputTimestampAnalysis1Test.class, + MethodCallThoughputTimestampAnalysis1Test.class, MethodCallThoughputTimestampAnalysis9Test.class, MethodCallThoughputTimestampAnalysis10Test.class, MethodCallThoughputTimestampAnalysis11Test.class, @@ -41,7 +42,7 @@ public class ComparisonMethodcallWithPorts { @AfterClass public static void compareResults() { - PerformanceCheckProfile pcp = PerformanceCheckProfileRepository.INSTANCE.get(ComparisonMethodcallWithPorts.class); + ProfiledPerformanceAssertion pcp = PerformanceCheckProfileRepository.INSTANCE.get(ComparisonMethodcallWithPorts.class); pcp.check(); } diff --git a/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java index bb3c2f6c434264d7fa5283d4ad4d4cf1b4e31ef9..ea8e30a49b7c2e27c1791582d983e7626678060f 100644 --- a/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java +++ b/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java @@ -5,11 +5,11 @@ import static org.junit.Assert.assertEquals; import java.util.Map; import java.util.Map.Entry; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class NieWorkComparisonMethodcallWithPorts implements PerformanceCheckProfile { +public class NieWorkComparisonMethodcallWithPorts extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { diff --git a/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java index 525abdb84b7630dd8c3da6355b8dbef9e1af098b..9c9321d3bfccbe7a004a9b5e31ff8ec24702f52f 100644 --- a/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java @@ -1,11 +1,11 @@ package teetime.examples.experiment01; import static org.junit.Assert.assertEquals; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwHomePerformanceCheck implements PerformanceCheckProfile { +public class ChwHomePerformanceCheck extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { diff --git a/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java index 3229033091c918d7556168a446dab9804066be19..0f7c9f1912896f178be06e132f36508ab8c7cd51 100644 --- a/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java @@ -1,11 +1,11 @@ package teetime.examples.experiment01; import static org.junit.Assert.assertEquals; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwWorkPerformanceCheck implements PerformanceCheckProfile { +public class ChwWorkPerformanceCheck extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { diff --git a/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java b/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java index b6ded5499195cd17dd690f3a5dd7c0f0292618fd..6577d3a39584285b83403a502e4bf83f5229505d 100644 --- a/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java +++ b/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java @@ -19,13 +19,11 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import teetime.examples.experiment16.ChwHomePerformanceCheck; -import teetime.examples.experiment16.ChwWorkPerformanceCheck; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceCheckProfile; -import util.PerformanceCheckProfileRepository; -import util.PerformanceTest; +import util.test.PerformanceCheckProfileRepository; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; /** * @author Christian Wulf @@ -42,7 +40,7 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest { @AfterClass public static void afterClass() { - PerformanceCheckProfile performanceCheckProfile = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis1Test.class); + ProfiledPerformanceAssertion performanceCheckProfile = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis1Test.class); performanceCheckProfile.check(); }; diff --git a/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java b/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java index f84be673984f36e5fec20de7fc408466118f8986..3f494dee35f14d499578ab4e895fbc04541e71c7 100644 --- a/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java +++ b/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java @@ -17,7 +17,11 @@ package teetime.examples.experiment01; import java.util.List; -import teetime.framework.OldAnalysis; +import teetime.examples.experiment01.legacystage.LegacyCollectorSink; +import teetime.examples.experiment01.legacystage.LegacyNoopFilter; +import teetime.examples.experiment01.legacystage.LegacyObjectProducer; +import teetime.examples.experiment01.legacystage.LegacyStartTimestampFilter; +import teetime.examples.experiment01.legacystage.LegacyStopTimestampFilter; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; @@ -26,7 +30,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis1 extends OldAnalysis { +public class MethodCallThroughputAnalysis1 { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -34,52 +38,48 @@ public class MethodCallThroughputAnalysis1 extends OldAnalysis { private List<TimestampObject> timestampObjects; private Runnable runnable; - @Override public void init() { - super.init(); - // this.runnable = this.buildPipeline(); + this.runnable = this.buildPipeline(); } /** * @param numNoopFilters * @since 1.10 */ - // private Runnable buildPipeline() { - // @SuppressWarnings("unchecked") - // final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // // create stages - // final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - // final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - // for (int i = 0; i < noopFilters.length; i++) { - // noopFilters[i] = new NoopFilter<TimestampObject>(); - // } - // final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - // final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - // - // final Runnable runnable = new Runnable() { - // @Override - // public void run() { - // while (true) { - // TimestampObject object = objectProducer.execute(null); - // if (object == null) { - // return; - // } - // - // object = startTimestampFilter.execute(object); - // for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - // object = noopFilter.execute(object); - // } - // object = stopTimestampFilter.execute(object); - // collectorSink.execute(object); - // } - // } - // }; - // return runnable; - // } + private Runnable buildPipeline() { + @SuppressWarnings("unchecked") + final LegacyNoopFilter<TimestampObject>[] noopFilters = new LegacyNoopFilter[this.numNoopFilters]; + // create stages + final LegacyObjectProducer<TimestampObject> objectProducer = new LegacyObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); + final LegacyStartTimestampFilter startTimestampFilter = new LegacyStartTimestampFilter(); + for (int i = 0; i < noopFilters.length; i++) { + noopFilters[i] = new LegacyNoopFilter<TimestampObject>(); + } + final LegacyStopTimestampFilter stopTimestampFilter = new LegacyStopTimestampFilter(); + final LegacyCollectorSink<TimestampObject> collectorSink = new LegacyCollectorSink<TimestampObject>(this.timestampObjects); + + final Runnable runnable = new Runnable() { + @Override + public void run() { + while (true) { + TimestampObject object = objectProducer.execute(); + if (object == null) { + return; + } + + object = startTimestampFilter.execute(object); + for (final LegacyNoopFilter<TimestampObject> noopFilter : noopFilters) { + object = noopFilter.execute(object); + } + object = stopTimestampFilter.execute(object); + collectorSink.execute(object); + } + } + }; + return runnable; + } - @Override public void start() { - super.start(); this.runnable.run(); } diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java new file mode 100644 index 0000000000000000000000000000000000000000..50282c803115c2721e5f4fbd00cfa55e5947f19d --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ +package teetime.examples.experiment01.legacystage; + +import java.util.List; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class LegacyCollectorSink<T> { + + // private final InputPort<T> inputPort = this.createInputPort(); + // + // public final InputPort<T> getInputPort() { + // return this.inputPort; + // } + + private final List<T> elements; + private final int threshold; + + public LegacyCollectorSink(final List<T> list, final int threshold) { + this.elements = list; + this.threshold = threshold; + } + + public LegacyCollectorSink(final List<T> list) { + this(list, 100000); + } + + public void onIsPipelineHead() { + System.out.println("size: " + this.elements.size()); + } + + public Object execute(final T element) { + this.elements.add(element); + + if ((this.elements.size() % this.threshold) == 0) { + System.out.println("size: " + this.elements.size()); + } + + return new Object(); + // if (this.elements.size() > 90000) { + // // System.out.println("size > 90000: " + this.elements.size()); + // } + } + +} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java new file mode 100644 index 0000000000000000000000000000000000000000..c5247c212ed954a9ff7d7740f6dae74b2fd5c568 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ +package teetime.examples.experiment01.legacystage; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class LegacyNoopFilter<T> { + + public T execute(final T element) { + return element; + } + +} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java new file mode 100644 index 0000000000000000000000000000000000000000..16b93fbf34871e3742b35df32083a17a350e5734 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ +package teetime.examples.experiment01.legacystage; + +import teetime.util.ConstructorClosure; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class LegacyObjectProducer<T> { + + private long numInputObjects; + private ConstructorClosure<T> inputObjectCreator; + + /** + * @since 1.10 + */ + public LegacyObjectProducer(final long numInputObjects, final ConstructorClosure<T> inputObjectCreator) { + this.numInputObjects = numInputObjects; + this.inputObjectCreator = inputObjectCreator; + } + + public long getNumInputObjects() { + return this.numInputObjects; + } + + public void setNumInputObjects(final long numInputObjects) { + this.numInputObjects = numInputObjects; + } + + public ConstructorClosure<T> getInputObjectCreator() { + return this.inputObjectCreator; + } + + public void setInputObjectCreator(final ConstructorClosure<T> inputObjectCreator) { + this.inputObjectCreator = inputObjectCreator; + } + + public T execute() { + if (this.numInputObjects == 0) { + return null; + } + + T newObject = this.inputObjectCreator.create(); + this.numInputObjects--; + + return newObject; + + } + +} diff --git a/src/main/java/teetime/framework/OldAnalysis.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java similarity index 74% rename from src/main/java/teetime/framework/OldAnalysis.java rename to src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java index 914c52b84cfdb8be535302b75b359afaba654e15..f2d119b9edc3cfb1a260b24cd20a15066cda0298 100644 --- a/src/main/java/teetime/framework/OldAnalysis.java +++ b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java @@ -13,26 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ +package teetime.examples.experiment01.legacystage; -package teetime.framework; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -@Deprecated -public class OldAnalysis { +public class LegacyStartTimestampFilter { - public void init() { - System.out.println("Analysis initialized."); + public TimestampObject execute(final TimestampObject element) { + element.setStartTimestamp(System.nanoTime()); + return element; } - public void start() { - // System.out.println("Analysis started."); - } - - public void onTerminate() { - System.out.println("Analysis stopped."); - } } diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java new file mode 100644 index 0000000000000000000000000000000000000000..1f77d38a4a216a053a2ee1c0c38d549ac5b54a16 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ +package teetime.examples.experiment01.legacystage; + +import teetime.util.TimestampObject; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class LegacyStopTimestampFilter { + + public TimestampObject execute(final TimestampObject element) { + element.setStopTimestamp(System.nanoTime()); + return element; + } + +} diff --git a/src/performancetest/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java b/src/performancetest/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java index bd5d52fa6c0d9eed4ad6a7e81989a8cdfc021349..489f6e4a78494ca24b5792f7d1b2859f295d7e3b 100644 --- a/src/performancetest/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java +++ b/src/performancetest/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; /** * @author Christian Wulf diff --git a/src/performancetest/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java b/src/performancetest/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java index 5ffed1c118611ce15eb3ed3ad270e9de439c263c..cd600de665c628cf1a4f7915d288173ff6c2780c 100644 --- a/src/performancetest/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java +++ b/src/performancetest/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java @@ -19,7 +19,6 @@ import java.util.List; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.CommittablePipe; import teetime.stage.CollectorSink; @@ -35,7 +34,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis9 extends OldAnalysis { +public class MethodCallThroughputAnalysis9 { private int numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -43,9 +42,7 @@ public class MethodCallThroughputAnalysis9 extends OldAnalysis { private List<TimestampObject> timestampObjects; private Runnable runnable; - @Override public void init() { - super.init(); HeadStage pipeline = this.buildPipeline(); this.runnable = new RunnableStage(pipeline); } @@ -82,9 +79,7 @@ public class MethodCallThroughputAnalysis9 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.runnable.run(); } diff --git a/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..20fffa4c24079f1f761ad40825af0ee89d7736a4 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment10/ChwHomePerformanceCheck.java @@ -0,0 +1,35 @@ +package teetime.examples.experiment10; + +import static org.junit.Assert.assertEquals; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwHomePerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwHome"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test10 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); + + double meanSpeedup = (double) test10.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("meanSpeedup (10): " + meanSpeedup); + + // since 26.06.2014 (incl.) + // assertEquals(26, value10, 2.1); // +14 + // // since 04.07.2014 (incl.) + // assertEquals(26, value10, 2.1); // +0 + // since 11.08.2014 (incl.) + // assertEquals(47, value10, 2.1); // +21 + // since 31.08.2014 (incl.) + assertEquals(51, meanSpeedup, 2.1); + } +} diff --git a/src/performancetest/java/teetime/examples/experiment10/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment10/ChwWorkPerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..70d999686ddbf253c88614185f878d78d5986689 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment10/ChwWorkPerformanceCheck.java @@ -0,0 +1,37 @@ +package teetime.examples.experiment10; + +import static org.junit.Assert.assertEquals; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwWorkPerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwWork"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test10 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); + + double medianSpeedup = (double) test10.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("medianSpeedup (10): " + medianSpeedup); + + // until 25.06.2014 (incl.) + // assertEquals(14, (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); + // since 26.06.2014 (incl.) + // assertEquals(26, meanSpeedup, 2.1); // +14 + // since 04.07.2014 (incl.) + // assertEquals(26, meanSpeedup, 2.1); // +0 + // since 27.08.2014 (incl.) + // assertEquals(56, meanSpeedup, 2.1); // +30 + // since 14.10.2014 (incl.) + assertEquals(56, medianSpeedup, 2.1); // +0 + } +} diff --git a/src/performancetest/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java b/src/performancetest/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java index d8b872035a26c2dd77b0a45dda3167536e8684c5..f73409d333e023ebe57d956dcc1a7d82c14809f6 100644 --- a/src/performancetest/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java +++ b/src/performancetest/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java @@ -15,19 +15,34 @@ ***************************************************************************/ package teetime.examples.experiment10; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThoughputTimestampAnalysis10Test extends PerformanceTest { + @BeforeClass + public static void beforeClass() { + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis10Test.class, new ChwWorkPerformanceCheck()); + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis10Test.class, new ChwHomePerformanceCheck()); + }; + + @AfterClass + public static void afterClass() { + ProfiledPerformanceAssertion performanceCheckProfile = PERFORMANCE_CHECK_PROFILE_REPOSITORY.get(MethodCallThoughputTimestampAnalysis10Test.class); + performanceCheckProfile.check(); + }; + @Test public void testWithManyObjects() { System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" diff --git a/src/performancetest/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java b/src/performancetest/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java index 4cc544f9722feb7ea94cba4351ed8b774e46c0f0..82a31ff2bcdb706b0b67aec457fee9b82880636b 100644 --- a/src/performancetest/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java +++ b/src/performancetest/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java @@ -18,7 +18,6 @@ package teetime.examples.experiment10; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.stage.CollectorSink; @@ -34,7 +33,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis10 extends OldAnalysis { +public class MethodCallThroughputAnalysis10 { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -42,9 +41,7 @@ public class MethodCallThroughputAnalysis10 extends OldAnalysis { private List<TimestampObject> timestampObjects; private Runnable runnable; - @Override public void init() { - super.init(); this.runnable = this.buildPipeline(); } @@ -79,9 +76,7 @@ public class MethodCallThroughputAnalysis10 extends OldAnalysis { return new RunnableStage(pipeline); } - @Override public void start() { - super.start(); this.runnable.run(); } diff --git a/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..6b5d256d1ac58d6147532a0b9dbbf4ce522f9b06 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java @@ -0,0 +1,37 @@ +package teetime.examples.experiment11; + +import static org.junit.Assert.assertEquals; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwHomePerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwHome"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test11 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); + + double medianSpeedup = (double) test11.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("medianSpeedup (11): " + medianSpeedup); + + // until 25.06.2014 (incl.) + // assertEquals(32, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); + // since 26.06.2014 (incl.) + // assertEquals(44, medianSpeedup, 4.1); // +12 + // since 04.07.2014 (incl.) + // assertEquals(41, medianSpeedup, 4.1); // -3 + // since 11.08.2014 (incl.) + // assertEquals(41, medianSpeedup, 4.1); // -3 + // since 31.08.2014 (incl.) + assertEquals(43, medianSpeedup, 4.1); // ?? + } +} diff --git a/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..65049146d5c0fa586343bbc91c91f0b3c8c4bb59 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java @@ -0,0 +1,37 @@ +package teetime.examples.experiment11; + +import static org.junit.Assert.assertEquals; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwWorkPerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwWork"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test11 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); + + double medianSpeedup = (double) test11.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("medianSpeedup (11): " + medianSpeedup); + + // until 25.06.2014 (incl.) + // assertEquals(32, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); + // since 26.06.2014 (incl.) + // assertEquals(44, medianSpeedup, 4.1); // +12 + // since 04.07.2014 (incl.) + // assertEquals(41, medianSpeedup, 4.1); // -3 + // since 27.08.2014 (incl.) + // assertEquals(64, medianSpeedup, 4.1); // +15 + // since 14.10.2014 (incl.) + assertEquals(44, medianSpeedup, 4.1); // -20 + } +} diff --git a/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java b/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java index a6149b9a0f812e827b3150729fdf98ce42905a6a..80e22ff08ea51e7e721e36cd2d71527dd205b9ac 100644 --- a/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java +++ b/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java @@ -15,19 +15,34 @@ ***************************************************************************/ package teetime.examples.experiment11; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest { + @BeforeClass + public static void beforeClass() { + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis11Test.class, new ChwWorkPerformanceCheck()); + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis11Test.class, new ChwHomePerformanceCheck()); + }; + + @AfterClass + public static void afterClass() { + ProfiledPerformanceAssertion performanceCheckProfile = PERFORMANCE_CHECK_PROFILE_REPOSITORY.get(MethodCallThoughputTimestampAnalysis11Test.class); + performanceCheckProfile.check(); + }; + @Test public void testWithManyObjects() { System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" diff --git a/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java b/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java index 76dc925eaf56ed5b348111dd867220484a501a91..07b681ab9d9dd7bee6ce09a3eb9f045d880eb5fd 100644 --- a/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java +++ b/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java @@ -19,7 +19,6 @@ import java.util.List; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.UnorderedGrowablePipe; import teetime.stage.CollectorSink; @@ -35,7 +34,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis11 extends OldAnalysis { +public class MethodCallThroughputAnalysis11 { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -43,9 +42,7 @@ public class MethodCallThroughputAnalysis11 extends OldAnalysis { private List<TimestampObject> timestampObjects; private Runnable runnable; - @Override public void init() { - super.init(); HeadStage pipeline = this.buildPipeline(this.numInputObjects, this.inputObjectCreator); this.runnable = new RunnableStage(pipeline); } @@ -83,9 +80,7 @@ public class MethodCallThroughputAnalysis11 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.runnable.run(); } diff --git a/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..13ea4e873046f5bd4bd2b89cdc698f91931cc455 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment14/ChwHomePerformanceCheck.java @@ -0,0 +1,37 @@ +package teetime.examples.experiment14; + +import static org.junit.Assert.assertEquals; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwHomePerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwHome"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); + PerformanceResult test14 = PerformanceTest.measurementRepository.performanceResults + .get("testWithManyObjects(teetime.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test)"); + + double medianSpeedup = (double) test14.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("medianSpeedup (14): " + medianSpeedup); + + // until 25.06.2014 (incl.) + // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // since 26.06.2014 (incl.) + // assertEquals(76, medianSpeedup, 5.1); // +16 + // since 04.07.2014 (incl.) + // assertEquals(86, medianSpeedup, 5.1); // +16 + // since 11.08.2014 (incl.) + // assertEquals(103, medianSpeedup, 5.1); // +17 + // since 31.08.2014 (incl.) + assertEquals(62, medianSpeedup, 2.1); // -41 + } +} diff --git a/src/performancetest/java/teetime/examples/experiment14/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment14/ChwWorkPerformanceCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..8f2dabdc54cf55b1d6d59fecaa763c9a994f6497 --- /dev/null +++ b/src/performancetest/java/teetime/examples/experiment14/ChwWorkPerformanceCheck.java @@ -0,0 +1,38 @@ +package teetime.examples.experiment14; + +import static org.junit.Assert.assertEquals; +import teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; + +public class ChwWorkPerformanceCheck extends ProfiledPerformanceAssertion { + + @Override + public String getCorrespondingPerformanceProfile() { + return "ChwWork"; + } + + @Override + public void check() { + PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults + .get(buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis1Test.class, "testWithManyObjects")); + PerformanceResult test14 = PerformanceTest.measurementRepository.performanceResults + .get(buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis14Test.class, "testWithManyObjects")); + + double medianSpeedup = (double) test14.quantiles.get(0.5) / test01.quantiles.get(0.5); + + System.out.println("medianSpeedup (14): " + medianSpeedup); + + // until 25.06.2014 (incl.) + // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); + // since 26.06.2014 (incl.) + // assertEquals(76, medianSpeedup, 5.1); // +16 + // since 04.07.2014 (incl.) + // assertEquals(86, medianSpeedup, 5.1); // +16 + // since 27.08.2014 (incl.) + // assertEquals(102, medianSpeedup, 5.1); // +16 + // since 14.10.2014 (incl.) + assertEquals(53, medianSpeedup, 5.1); // -49 + } +} diff --git a/src/performancetest/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java b/src/performancetest/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java index 1f87c070e9f6ee4434abdf91d34c8d0c385c69b2..3d743f81f0117071c84403f59e8adc5e558765d1 100644 --- a/src/performancetest/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java +++ b/src/performancetest/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java @@ -15,19 +15,34 @@ ***************************************************************************/ package teetime.examples.experiment14; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThoughputTimestampAnalysis14Test extends PerformanceTest { + @BeforeClass + public static void beforeClass() { + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis14Test.class, new ChwWorkPerformanceCheck()); + PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis14Test.class, new ChwHomePerformanceCheck()); + }; + + @AfterClass + public static void afterClass() { + ProfiledPerformanceAssertion performanceCheckProfile = PERFORMANCE_CHECK_PROFILE_REPOSITORY.get(MethodCallThoughputTimestampAnalysis14Test.class); + performanceCheckProfile.check(); + }; + @Test public void testWithManyObjects() { System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" diff --git a/src/performancetest/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java b/src/performancetest/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java index 3b32e2bdadd7c333e92dda19187ec7e673eb8e3c..0853c73213650fbea5fc324951ebcd91fff2950b 100644 --- a/src/performancetest/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java +++ b/src/performancetest/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java @@ -19,7 +19,6 @@ import java.util.List; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.PipeFactory; @@ -38,7 +37,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis14 extends OldAnalysis { +public class MethodCallThroughputAnalysis14 { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -47,9 +46,7 @@ public class MethodCallThroughputAnalysis14 extends OldAnalysis { private Runnable runnable; private final PipeFactory pipeFactory = PipeFactory.INSTANCE; - @Override public void init() { - super.init(); HeadStage pipeline = this.buildPipeline(); this.runnable = new RunnableStage(pipeline); } @@ -88,9 +85,7 @@ public class MethodCallThroughputAnalysis14 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.runnable.run(); } diff --git a/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java b/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java index 91faf50943bd301c7c395a24d384d6afd6b4f1af..356647b0f19e5fbe80d27e98847d32f5a8a8de92 100644 --- a/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java +++ b/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java @@ -19,7 +19,7 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; /** * @author Christian Wulf diff --git a/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java b/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java index acadf1ede7a143e522d2617c539f6ba846cf3c4b..6850f50cabddee7841602aa3179097f4ebced016 100644 --- a/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java +++ b/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java @@ -19,7 +19,6 @@ import java.util.List; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.OrderedGrowableArrayPipe; import teetime.framework.pipe.SingleElementPipe; @@ -40,7 +39,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis15 extends OldAnalysis { +public class MethodCallThroughputAnalysis15 { // FIXME this analysis sometimes runs infinitely private static final int SPSC_INITIAL_CAPACITY = 4; @@ -54,9 +53,7 @@ public class MethodCallThroughputAnalysis15 extends OldAnalysis { private Runnable runnable; private Clock clock; - @Override public void init() { - super.init(); HeadPipeline<Clock, Sink<Long>> clockPipeline = this.buildClockPipeline(); this.clockRunnable = new RunnableStage(clockPipeline); @@ -115,9 +112,7 @@ public class MethodCallThroughputAnalysis15 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); Thread clockThread = new Thread(this.clockRunnable); clockThread.start(); this.runnable.run(); diff --git a/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java index a3106094fb720993ecbd804ef6ad7cc67d58c0be..29a27cf7b1b80831cc30b5db330429f51686a399 100644 --- a/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java @@ -1,11 +1,11 @@ package teetime.examples.experiment16; import static org.junit.Assert.assertEquals; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwHomePerformanceCheck implements PerformanceCheckProfile { +public class ChwHomePerformanceCheck extends ProfiledPerformanceAssertion { @Override public String getCorrespondingPerformanceProfile() { diff --git a/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java index eba4502dfcf156fbc90d99838d11d0da4ca768f3..8aeae42d96d7c92a9f652774ed37612e8dc3e9de 100644 --- a/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java +++ b/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java @@ -1,11 +1,11 @@ package teetime.examples.experiment16; import static org.junit.Assert.assertEquals; -import util.PerformanceCheckProfile; -import util.PerformanceResult; -import util.PerformanceTest; +import util.test.PerformanceResult; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; -public class ChwWorkPerformanceCheck implements PerformanceCheckProfile { +public class ChwWorkPerformanceCheck extends ProfiledPerformanceAssertion { @Override public void check() { diff --git a/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java b/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java index 86bb46fb274ed3e71b34f0d28f5e554002976cf3..7dd7ea2b0e1b8536d0afd902e5a88f0db4606bd9 100644 --- a/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java +++ b/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java @@ -24,9 +24,9 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.util.TimestampObject; -import util.PerformanceCheckProfile; -import util.PerformanceCheckProfileRepository; -import util.PerformanceTest; +import util.test.PerformanceCheckProfileRepository; +import util.test.PerformanceTest; +import util.test.ProfiledPerformanceAssertion; /** * @author Christian Wulf @@ -42,7 +42,13 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest public static void beforeClass() { PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwWorkPerformanceCheck()); PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwHomePerformanceCheck()); - }; + } + + @AfterClass + public static void afterClass() { + ProfiledPerformanceAssertion pcp = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis16Test.class); + pcp.check(); + } @Test public void testWithManyObjectsAnd1Thread() { @@ -59,12 +65,6 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest this.performAnalysis(4); } - @AfterClass - public static void afterClass() { - PerformanceCheckProfile pcp = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis16Test.class); - pcp.check(); - } - private void performAnalysis(final int numThreads) { System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" + NUM_NOOP_FILTERS + "..."); @@ -85,7 +85,6 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } this.timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList()); diff --git a/src/performancetest/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java b/src/performancetest/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java index 426d108c61443d2406ea65552f0671f2ddc78a1d..c84c2bad7ded7a93e6fbfe3449afe0e922966751 100644 --- a/src/performancetest/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java +++ b/src/performancetest/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java @@ -20,7 +20,6 @@ import java.util.LinkedList; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -39,7 +38,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis16 extends OldAnalysis { +public class MethodCallThroughputAnalysis16 { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); @@ -56,9 +55,7 @@ public class MethodCallThroughputAnalysis16 extends OldAnalysis { private int numWorkerThreads; - @Override public void init() { - super.init(); HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, this.inputObjectCreator); this.producerThread = new Thread(new RunnableStage(producerPipeline)); @@ -125,9 +122,7 @@ public class MethodCallThroughputAnalysis16 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.producerThread.start(); diff --git a/src/performancetest/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java b/src/performancetest/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java index 69137f7471c73b9e48acfd343e2cead3ec7a99cf..650d11706482de244efd7db554a15041c0731391 100644 --- a/src/performancetest/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java +++ b/src/performancetest/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java @@ -20,11 +20,11 @@ import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest { @@ -52,7 +52,6 @@ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } this.timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList()); diff --git a/src/performancetest/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java b/src/performancetest/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java index c1954504e7a0a135138dceffa148ffcb4dd030a1..b5a59e24c8f8e61cbd5bf32b8fc93077f549678f 100644 --- a/src/performancetest/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java +++ b/src/performancetest/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java @@ -20,7 +20,6 @@ import java.util.LinkedList; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.StageWithPort; import teetime.framework.pipe.DummyPipe; @@ -45,7 +44,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis17 extends OldAnalysis { +public class MethodCallThroughputAnalysis17 { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); @@ -60,7 +59,6 @@ public class MethodCallThroughputAnalysis17 extends OldAnalysis { private Thread producerThread; private Thread[] workerThreads; - @Override public void init() { HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, this.inputObjectCreator); @@ -107,7 +105,6 @@ public class MethodCallThroughputAnalysis17 extends OldAnalysis { // e1.printStackTrace(); // } - super.init(); } @SuppressWarnings("unchecked") @@ -169,9 +166,7 @@ public class MethodCallThroughputAnalysis17 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); for (Thread workerThread : this.workerThreads) { workerThread.start(); diff --git a/src/performancetest/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java b/src/performancetest/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java deleted file mode 100644 index e36abb3b103ab569ab8702c2e211c31f7ded408a..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java +++ /dev/null @@ -1,171 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.examples.experiment18; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; -import teetime.framework.RunnableStage; -import teetime.framework.pipe.SpScPipe; -import teetime.framework.pipe.UnorderedGrowablePipe; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.Relay; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.stage.basic.distributor.Distributor; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis18 extends OldAnalysis { - - private static final int SPSC_INITIAL_CAPACITY = 4; - private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - - private final List<List<TimestampObject>> timestampObjectsList = new LinkedList<List<TimestampObject>>(); - - private Thread producerThread; - - private Thread[] workerThreads; - - private int numWorkerThreads; - - @Override - public void init() { - super.init(); - HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, - this.inputObjectCreator); - this.producerThread = new Thread(new RunnableStage(producerPipeline)); - - this.numWorkerThreads = Math.min(NUM_WORKER_THREADS, this.numWorkerThreads); - - this.workerThreads = new Thread[this.numWorkerThreads]; - for (int i = 0; i < this.workerThreads.length; i++) { - List<TimestampObject> resultList = new ArrayList<TimestampObject>(this.numInputObjects); - this.timestampObjectsList.add(resultList); - - HeadPipeline<?, ?> pipeline = this.buildPipeline(producerPipeline, resultList); - this.workerThreads[i] = new Thread(new RunnableStage(pipeline)); - } - } - - private HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> buildProducerPipeline(final int numInputObjects, - final ConstructorClosure<TimestampObject> inputObjectCreator) { - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(numInputObjects, inputObjectCreator); - Distributor<TimestampObject> distributor = new Distributor<TimestampObject>(); - - final HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> pipeline = new HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(distributor); - - UnorderedGrowablePipe.connect(objectProducer.getOutputPort(), distributor.getInputPort()); - - return pipeline; - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private HeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> buildPipeline( - final HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> previousStage, - final List<TimestampObject> timestampObjects) { - Relay<TimestampObject> relay = new Relay<TimestampObject>(); - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(timestampObjects); - - final HeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new HeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(relay); - pipeline.setLastStage(collectorSink); - - SpScPipe.connect(previousStage.getLastStage().getNewOutputPort(), relay.getInputPort(), SPSC_INITIAL_CAPACITY); - - UnorderedGrowablePipe.connect(relay.getOutputPort(), startTimestampFilter.getInputPort()); - - UnorderedGrowablePipe.connect(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - UnorderedGrowablePipe.connect(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - UnorderedGrowablePipe.connect(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - UnorderedGrowablePipe.connect(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - @Override - public void start() { - super.start(); - - for (Thread workerThread : this.workerThreads) { - workerThread.start(); - } - - try { - for (Thread workerThread : this.workerThreads) { - workerThread.join(); - } - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<List<TimestampObject>> getTimestampObjectsList() { - return this.timestampObjectsList; - } - - public int getNumWorkerThreads() { - return this.numWorkerThreads; - } - - public void setNumWorkerThreads(final int numWorkerThreads) { - this.numWorkerThreads = numWorkerThreads; - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java b/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java index 32f76c6039eca899468fc0ffea2bdcec470da6b0..59d13f1d98a19fde419451f63662eabdc5fa4b0d 100644 --- a/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java +++ b/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java @@ -22,11 +22,11 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; import teetime.util.TimestampObject; -import util.PerformanceTest; +import util.test.PerformanceTest; /** * @author Christian Wulf - * + * * @since 1.10 */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -82,7 +82,6 @@ public class MethodCallThoughputTimestampAnalysis19Test extends PerformanceTest analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } this.timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList()); diff --git a/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java b/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java index 9f6f95c1963077cdfc609a40fb4442c017ef4da0..b91a703bc3f61df66be2ccb72a2f174c34b9b7a9 100644 --- a/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java +++ b/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java @@ -20,7 +20,6 @@ import java.util.LinkedList; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.OrderedGrowableArrayPipe; import teetime.framework.pipe.SpScPipe; @@ -39,7 +38,7 @@ import teetime.util.TimestampObject; * * @since 1.10 */ -public class MethodCallThroughputAnalysis19 extends OldAnalysis { +public class MethodCallThroughputAnalysis19 { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); @@ -56,9 +55,7 @@ public class MethodCallThroughputAnalysis19 extends OldAnalysis { private int numWorkerThreads; - @Override public void init() { - super.init(); HeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, this.inputObjectCreator); this.producerThread = new Thread(new RunnableStage(producerPipeline)); @@ -120,9 +117,7 @@ public class MethodCallThroughputAnalysis19 extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.producerThread.start(); diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java index 0f8fce8e28cd9e8c49aa7511cfc9975cf3420202..20e61eb6b5dca3d74bf8f95aaf3c3fdc0d147830 100644 --- a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java +++ b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java @@ -1,24 +1,19 @@ package teetime.examples.kiekerdays; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.stage.io.TCPReader; -public class TcpTraceLogging extends OldAnalysis { +public class TcpTraceLogging { private Thread tcpThread; - @Override public void init() { - super.init(); HeadStage tcpPipeline = this.buildTcpPipeline(); this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); } - @Override public void start() { - super.start(); this.tcpThread.start(); @@ -43,7 +38,6 @@ public class TcpTraceLogging extends OldAnalysis { try { analysis.start(); } finally { - analysis.onTerminate(); } } diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java index 08975c93b73b7b6f13d23a90e8fd4aa6d9a5e8e3..9f3eab50be0bcf52b01a19330500a10ee3a37a79 100644 --- a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java +++ b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java @@ -2,7 +2,6 @@ package teetime.examples.kiekerdays; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.stage.basic.Sink; @@ -10,20 +9,16 @@ import teetime.stage.explorviz.KiekerRecordTcpReader; import kieker.common.record.IMonitoringRecord; -public class TcpTraceLoggingExplorviz extends OldAnalysis { +public class TcpTraceLoggingExplorviz { private Thread tcpThread; - @Override public void init() { - super.init(); HeadStage tcpPipeline = this.buildTcpPipeline(); this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); } - @Override public void start() { - super.start(); this.tcpThread.start(); @@ -54,7 +49,6 @@ public class TcpTraceLoggingExplorviz extends OldAnalysis { try { analysis.start(); } finally { - analysis.onTerminate(); } } diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java index e1fa8409e924d93d919e16c43ccd804af5894676..ccafe970b144bbbfc68ed7adc1c50568c22f94a7 100644 --- a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java +++ b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java @@ -6,7 +6,6 @@ import java.util.List; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -23,7 +22,7 @@ import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReconstruction extends OldAnalysis { +public class TcpTraceReconstruction { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; @@ -38,9 +37,7 @@ public class TcpTraceReconstruction extends OldAnalysis { private int numWorkerThreads; - @Override public void init() { - super.init(); HeadPipeline<TCPReader, Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline(); this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); @@ -89,9 +86,7 @@ public class TcpTraceReconstruction extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.tcpThread.start(); @@ -110,14 +105,12 @@ public class TcpTraceReconstruction extends OldAnalysis { } } - @Override public void onTerminate() { int maxNumWaits = 0; for (SpScPipe pipe : this.tcpRelayPipes) { maxNumWaits = Math.max(maxNumWaits, pipe.getNumWaits()); } System.out.println("max #waits of TcpRelayPipes: " + maxNumWaits); - super.onTerminate(); } public List<TraceEventRecords> getElementCollection() { diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java index 6950e52260ce4bf22cc7c542bbf2308d2d0ca776..a5f865400f00b4773a1b9c3b1e3ede2b68e292ef 100644 --- a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java +++ b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java @@ -8,7 +8,6 @@ import java.util.TreeMap; import teetime.framework.HeadPipeline; import teetime.framework.HeadStage; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -29,7 +28,7 @@ import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReduction extends OldAnalysis { +public class TcpTraceReduction { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; @@ -46,9 +45,7 @@ public class TcpTraceReduction extends OldAnalysis { private int numWorkerThreads; - @Override public void init() { - super.init(); HeadPipeline<TCPReader, Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline(); this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); @@ -119,9 +116,7 @@ public class TcpTraceReduction extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.tcpThread.start(); this.clockThread.start(); @@ -142,14 +137,12 @@ public class TcpTraceReduction extends OldAnalysis { this.clockThread.interrupt(); } - @Override public void onTerminate() { int maxNumWaits = 0; for (SpScPipe pipe : this.tcpRelayPipes) { maxNumWaits = Math.max(maxNumWaits, pipe.getNumWaits()); } System.out.println("max #waits of TcpRelayPipes: " + maxNumWaits); - super.onTerminate(); } public List<TraceEventRecords> getElementCollection() { diff --git a/src/performancetest/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java b/src/performancetest/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java index 04f8c1cb6ebaa69df37767d28766d5d5eff3acdb..6b23a328646b716b1e0f1a743ea94d05df655959 100644 --- a/src/performancetest/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java +++ b/src/performancetest/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java @@ -34,11 +34,11 @@ import org.junit.runners.MethodSorters; import teetime.util.ListUtil; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf - * + * * @since 1.10 */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -71,7 +71,6 @@ public class ChwHomeTcpTraceReadingTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } List<Long> recordThroughputs = ListUtil.removeFirstHalfElements(analysis.getRecordThroughputs()); diff --git a/src/performancetest/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java b/src/performancetest/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java index 134eb645f5d2ec994d9daa94e8ae9b34f27f6a5e..fcf14f30f008543a81800f190fcebce259ad03fc 100644 --- a/src/performancetest/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java +++ b/src/performancetest/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java @@ -3,7 +3,6 @@ package teetime.examples.traceReading; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -16,7 +15,7 @@ import teetime.stage.io.TCPReader; import kieker.common.record.IMonitoringRecord; -public class TcpTraceLoggingExtAnalysis extends OldAnalysis { +public class TcpTraceLoggingExtAnalysis { private Thread clockThread; private Thread tcpThread; @@ -59,9 +58,7 @@ public class TcpTraceLoggingExtAnalysis extends OldAnalysis { return pipeline; } - @Override public void init() { - super.init(); HeadPipeline<Clock, Distributor<Long>> clockPipeline = this.buildClockPipeline(1000); this.clockThread = new Thread(new RunnableStage(clockPipeline)); @@ -70,9 +67,7 @@ public class TcpTraceLoggingExtAnalysis extends OldAnalysis { this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); } - @Override public void start() { - super.start(); this.tcpThread.start(); this.clockThread.start(); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java b/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java index e5f30380b48175241c091c0a1ddb5536b90e9b0d..1158dade907c11c392f4e6e30ff4cd16a3db55e7 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java @@ -32,11 +32,11 @@ import org.junit.Test; import teetime.util.ListUtil; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf - * + * * @since 1.10 */ public class ChwHomeTcpTraceReconstructionAnalysisTest { @@ -68,7 +68,6 @@ public class ChwHomeTcpTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } List<Long> recordThroughputs = ListUtil.removeFirstHalfElements(analysis.getRecordThroughputs()); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java b/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java index 149c134df0edbc705a916a4877ac6da1bd86927f..bf85954aff055d7cfc44b52da3acc95431c3d146 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java @@ -31,13 +31,13 @@ import org.junit.Before; import org.junit.Test; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; /** * @author Christian Wulf - * + * * @since 1.10 */ public class ChwHomeTraceReconstructionAnalysisTest { @@ -66,7 +66,6 @@ public class ChwHomeTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } StatisticsUtil.removeLeadingZeroThroughputs(analysis.getThroughputs()); @@ -96,7 +95,6 @@ public class ChwHomeTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } StatisticsUtil.removeLeadingZeroThroughputs(analysis.getThroughputs()); @@ -126,7 +124,6 @@ public class ChwHomeTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } StatisticsUtil.removeLeadingZeroThroughputs(analysis.getThroughputs()); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java b/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java index 8f99ad31f0af0e330b5424fe64725898b7b4e09f..8bc965b84c26c72a8074ab469ae9ea76ba4ea72d 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java @@ -25,11 +25,11 @@ import org.junit.Before; import org.junit.Test; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf - * + * * @since 1.10 */ public class ChwWorkTcpTraceReconstructionAnalysisTest { @@ -61,7 +61,6 @@ public class ChwWorkTcpTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } Map<Double, Long> quintiles = StatisticsUtil.calculateQuintiles(analysis.getTraceThroughputs()); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java b/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java index 3c0604ae876e5711c3bcb6042219ba56d8fee3ff..c7438eca97eedc4c28fafb7f1a367556c18f2ff0 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java @@ -31,13 +31,13 @@ import org.junit.Before; import org.junit.Test; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; /** * @author Christian Wulf - * + * * @since 1.10 */ public class ChwWorkTraceReconstructionAnalysisTest { @@ -66,7 +66,6 @@ public class ChwWorkTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(50002, analysis.getNumRecords()); @@ -94,7 +93,6 @@ public class ChwWorkTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(1489902, analysis.getNumRecords()); @@ -124,7 +122,6 @@ public class ChwWorkTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(17371, analysis.getNumRecords()); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java b/src/performancetest/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java index 9e45c3b6181d23135f2b1363485c5718d49eef9f..40f0170f52558cc7b5a1a394cfc8f7518c88f099 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java @@ -4,8 +4,6 @@ import java.io.File; import java.util.LinkedList; import java.util.List; -import teetime.framework.OldAnalysis; - import kieker.analysis.AnalysisController; import kieker.analysis.IAnalysisController; import kieker.analysis.IProjectContext; @@ -25,7 +23,7 @@ import kieker.analysis.stage.TimeReader; import kieker.common.configuration.Configuration; import kieker.common.record.flow.IFlowRecord; -public class KiekerTraceReconstructionAnalysis extends OldAnalysis { +public class KiekerTraceReconstructionAnalysis { private final IAnalysisController analysisController = new AnalysisController(); @@ -42,9 +40,7 @@ public class KiekerTraceReconstructionAnalysis extends OldAnalysis { this.inputDir = inputDir; } - @Override public void init() { - super.init(); final Configuration clockConfiguration = new Configuration(); clockConfiguration.setProperty(TimeReader.CONFIG_PROPERTY_VALUE_UPDATE_INTERVAL_NS, Integer.toString(50 * 1000 * 1000)); @@ -99,9 +95,7 @@ public class KiekerTraceReconstructionAnalysis extends OldAnalysis { } - @Override public void start() { - super.start(); try { this.analysisController.run(); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java b/src/performancetest/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java index 41a7926b63abd446ff473c8ff5ed1c0e03872324..daa1b9aef5fdadbe13c7aa30480c5285d8d9c46f 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java @@ -31,7 +31,7 @@ import org.junit.Before; import org.junit.Test; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; import kieker.analysis.plugin.filter.flow.TraceEventRecords; @@ -63,7 +63,6 @@ public class NieWorkKiekerTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(50002, analysis.getNumRecords()); @@ -89,7 +88,6 @@ public class NieWorkKiekerTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(1489901, analysis.getNumRecords()); @@ -117,7 +115,6 @@ public class NieWorkKiekerTraceReconstructionAnalysisTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } assertEquals(17371, analysis.getNumRecords()); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java b/src/performancetest/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java index e503a3d48531fee3c47c73c8e71c57c828f00231..ff835b17817bc32b0bfe5d532b39b53a4822ca5d 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java @@ -4,7 +4,6 @@ import java.util.LinkedList; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -23,7 +22,7 @@ import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReconstructionAnalysis extends OldAnalysis { +public class TcpTraceReconstructionAnalysis { private static final int MIO = 1000000; private static final int TCP_RELAY_MAX_SIZE = 2 * MIO; @@ -41,9 +40,7 @@ public class TcpTraceReconstructionAnalysis extends OldAnalysis { private ElementThroughputMeasuringStage<IFlowRecord> recordThroughputFilter; private ElementThroughputMeasuringStage<TraceEventRecords> traceThroughputFilter; - @Override public void init() { - super.init(); HeadPipeline<Clock, Distributor<Long>> clockStage = this.buildClockPipeline(1000); this.clockThread = new Thread(new RunnableStage(clockStage)); @@ -101,9 +98,7 @@ public class TcpTraceReconstructionAnalysis extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.workerThread.start(); // this.clockThread.start(); diff --git a/src/performancetest/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java b/src/performancetest/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java index 687084969a819fdf61e9734a85bfa1eba942f5fb..dd4545c820858902263ef4c5aca20a7490884c06 100644 --- a/src/performancetest/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java +++ b/src/performancetest/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java @@ -5,7 +5,6 @@ import java.util.LinkedList; import java.util.List; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SpScPipe; @@ -30,7 +29,7 @@ import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TraceReconstructionAnalysis extends OldAnalysis { +public class TraceReconstructionAnalysis { private final List<TraceEventRecords> elementCollection = new LinkedList<TraceEventRecords>(); @@ -46,9 +45,7 @@ public class TraceReconstructionAnalysis extends OldAnalysis { private File inputDir; - @Override public void init() { - super.init(); Clock clockStage = this.buildClockPipeline(); this.clockThread = new Thread(new RunnableStage(clockStage)); @@ -108,9 +105,7 @@ public class TraceReconstructionAnalysis extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.clockThread.start(); this.workerThread.start(); diff --git a/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java index 1b969f1c364f7ac3057a6a89bbcb458439d14e75..5e3af5a5935d97cb2dd7e6ea0dfd37712327b1ba 100644 --- a/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -36,7 +36,7 @@ import teetime.framework.Analysis; import teetime.framework.pipe.SpScPipe; import teetime.util.ListUtil; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java index 99e8e04bf50349e97abce274dce041e8fa162566..3082beaf4fc092e57df7728ec4c9c55ab0fce79f 100644 --- a/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/performancetest/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -31,7 +31,7 @@ import teetime.framework.Analysis; import teetime.framework.pipe.SpScPipe; import teetime.util.ListUtil; import teetime.util.StopWatch; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf diff --git a/src/performancetest/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java b/src/performancetest/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java index 340b416197e81cca1d0c5b278af3e29287cbe564..d7b58674de3cbc73deaac48deef643a4c7d80d2e 100644 --- a/src/performancetest/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java +++ b/src/performancetest/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java @@ -32,7 +32,7 @@ import org.junit.runners.MethodSorters; import teetime.util.ListUtil; import teetime.util.StopWatch; import util.MooBenchStarter; -import util.StatisticsUtil; +import util.test.StatisticsUtil; /** * @author Christian Wulf @@ -108,7 +108,6 @@ public class ChwWorkTcpTraceReductionAnalysisWithThreadsTest { analysis.start(); } finally { this.stopWatch.end(); - analysis.onTerminate(); } System.out.println("#waits of tcp-relay pipe: " + analysis.getTcpRelayPipe().getNumWaits()); diff --git a/src/performancetest/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java b/src/performancetest/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java index 8879fc237faaa131662fa65b1501e0e326324613..7153c5ccf4e56d311314eb8feab575ad0eb35d09 100644 --- a/src/performancetest/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java +++ b/src/performancetest/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java @@ -9,7 +9,6 @@ import java.util.Map; import java.util.TreeMap; import teetime.framework.HeadPipeline; -import teetime.framework.OldAnalysis; import teetime.framework.RunnableStage; import teetime.framework.StageWithPort; import teetime.framework.pipe.SingleElementPipe; @@ -36,7 +35,7 @@ import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; import kieker.common.record.flow.trace.TraceMetadata; -public class TcpTraceReductionAnalysisWithThreads extends OldAnalysis { +public class TcpTraceReductionAnalysisWithThreads { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; @@ -52,9 +51,7 @@ public class TcpTraceReductionAnalysisWithThreads extends OldAnalysis { private SpScPipe tcpRelayPipe; private int numWorkerThreads; - @Override public void init() { - super.init(); HeadPipeline<TCPReader, Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline(); this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); @@ -197,9 +194,7 @@ public class TcpTraceReductionAnalysisWithThreads extends OldAnalysis { return pipeline; } - @Override public void start() { - super.start(); this.tcpThread.start(); this.clockThread.start(); diff --git a/src/performancetest/java/teetime/util/StopWatchTest.java b/src/performancetest/java/teetime/util/StopWatchTest.java index 6ecf46a044916001a12de21e3c606b40ef4e89d9..5c0a6a0d721e27e2c44694115ce2b40576e27ec3 100644 --- a/src/performancetest/java/teetime/util/StopWatchTest.java +++ b/src/performancetest/java/teetime/util/StopWatchTest.java @@ -7,7 +7,7 @@ import java.util.Map; import org.junit.Test; -import util.StatisticsUtil; +import util.test.StatisticsUtil; public class StopWatchTest {