Skip to content
Snippets Groups Projects
Commit ead2a19c authored by Christian Wulf's avatar Christian Wulf
Browse files

added sysout for speedup tests

parent c96068ab
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment16; package teetime.variant.methodcallWithPorts.examples.experiment16;
import static org.junit.Assert.assertEquals;
import org.junit.AfterClass;
import org.junit.FixMethodOrder; import org.junit.FixMethodOrder;
import org.junit.Test; import org.junit.Test;
import org.junit.runners.MethodSorters; import org.junit.runners.MethodSorters;
...@@ -22,6 +25,7 @@ import org.junit.runners.MethodSorters; ...@@ -22,6 +25,7 @@ import org.junit.runners.MethodSorters;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.ListUtil; import teetime.util.ListUtil;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceResult;
import test.PerformanceTest; import test.PerformanceTest;
/** /**
...@@ -49,18 +53,24 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest ...@@ -49,18 +53,24 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest
this.performAnalysis(4); this.performAnalysis(4);
} }
// @AfterClass @AfterClass
// public static void afterClass() { public static void afterClass() {
// PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults
// .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); .get("testWithManyObjectsAnd1Thread(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)");
// PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults
// .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); .get("testWithManyObjectsAnd2Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)");
// PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults
// .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); .get("testWithManyObjectsAnd4Threads(teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)");
// // check speedup // check speedup
// assertEquals(2, (double) test16a.overallDurationInNs / test16b.overallDurationInNs, 0.2); double speedupB = (double) test16a.overallDurationInNs / test16b.overallDurationInNs;
// assertEquals(2.5, (double) test16a.overallDurationInNs / test16c.overallDurationInNs, 0.2); double speedupC = (double) test16a.overallDurationInNs / test16c.overallDurationInNs;
// }
System.out.println("speedupB: " + speedupB);
System.out.println("speedupC: " + speedupC);
assertEquals(2, speedupB, 0.3);
assertEquals(2.5, speedupC, 0.3);
}
private void performAnalysis(final int numThreads) { private void performAnalysis(final int numThreads) {
System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS="
......
...@@ -74,15 +74,6 @@ public class MethodCallThroughputAnalysis16 extends Analysis { ...@@ -74,15 +74,6 @@ public class MethodCallThroughputAnalysis16 extends Analysis {
Pipeline<TimestampObject, Void> workerPipeline = this.buildPipeline(producerPipeline, resultList); Pipeline<TimestampObject, Void> workerPipeline = this.buildPipeline(producerPipeline, resultList);
this.workerThreads[i] = new Thread(new RunnableStage<TimestampObject>(workerPipeline)); this.workerThreads[i] = new Thread(new RunnableStage<TimestampObject>(workerPipeline));
} }
// this.producerThread.start();
//
// try {
// this.producerThread.join();
// } catch (InterruptedException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
} }
private Pipeline<Void, TimestampObject> buildProducerPipeline(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { private Pipeline<Void, TimestampObject> buildProducerPipeline(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment