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

added @Before to all PerformanceTests

parent 16f4f4c7
No related branches found
No related tags found
No related merge requests found
Showing
with 93 additions and 191 deletions
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment01; package teetime.variant.methodcall.examples.experiment01;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest { ...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis1 analysis = new MethodCallThroughputAnalysis1(); final MethodCallThroughputAnalysis1 analysis = new MethodCallThroughputAnalysis1();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -54,14 +47,13 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest { ...@@ -54,14 +47,13 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment02; package teetime.variant.methodcall.examples.experiment02;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest { ...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis2 analysis = new MethodCallThroughputAnalysis2(); final MethodCallThroughputAnalysis2 analysis = new MethodCallThroughputAnalysis2();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest { ...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment03; package teetime.variant.methodcall.examples.experiment03;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest { ...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis3 analysis = new MethodCallThroughputAnalysis3(); final MethodCallThroughputAnalysis3 analysis = new MethodCallThroughputAnalysis3();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest { ...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment04; package teetime.variant.methodcall.examples.experiment04;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest { ...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis4 analysis = new MethodCallThroughputAnalysis4(); final MethodCallThroughputAnalysis4 analysis = new MethodCallThroughputAnalysis4();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest { ...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment05; package teetime.variant.methodcall.examples.experiment05;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis5Test extends PerformanceTest { ...@@ -40,12 +35,10 @@ public class MethodCallThoughputTimestampAnalysis5Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis5 analysis = new MethodCallThroughputAnalysis5(); final MethodCallThroughputAnalysis5 analysis = new MethodCallThroughputAnalysis5();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis5Test extends PerformanceTest { ...@@ -54,14 +47,12 @@ public class MethodCallThoughputTimestampAnalysis5Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment06; package teetime.variant.methodcall.examples.experiment06;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest { ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis6 analysis = new MethodCallThroughputAnalysis6(); final MethodCallThroughputAnalysis6 analysis = new MethodCallThroughputAnalysis6();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest { ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment07; package teetime.variant.methodcall.examples.experiment07;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest { ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis7 analysis = new MethodCallThroughputAnalysis7(); final MethodCallThroughputAnalysis7 analysis = new MethodCallThroughputAnalysis7();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest { ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment08; package teetime.variant.methodcall.examples.experiment08;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest { ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis8 analysis = new MethodCallThroughputAnalysis8(); final MethodCallThroughputAnalysis8 analysis = new MethodCallThroughputAnalysis8();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest { ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment12; package teetime.variant.methodcall.examples.experiment12;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis12 analysis = new MethodCallThroughputAnalysis12(); final MethodCallThroughputAnalysis12 analysis = new MethodCallThroughputAnalysis12();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcall.examples.experiment13; package teetime.variant.methodcall.examples.experiment13;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis13 analysis = new MethodCallThroughputAnalysis13(); final MethodCallThroughputAnalysis13 analysis = new MethodCallThroughputAnalysis13();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment09; package teetime.variant.methodcallWithPorts.examples.experiment09;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest { ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest {
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis9 analysis = new MethodCallThroughputAnalysis9(); final MethodCallThroughputAnalysis9 analysis = new MethodCallThroughputAnalysis9();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest { ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest {
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment10; package teetime.variant.methodcallWithPorts.examples.experiment10;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis10Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis10Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis10 analysis = new MethodCallThroughputAnalysis10(); final MethodCallThroughputAnalysis10 analysis = new MethodCallThroughputAnalysis10();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis10Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis10Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment11; package teetime.variant.methodcallWithPorts.examples.experiment11;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis11 analysis = new MethodCallThroughputAnalysis11(); final MethodCallThroughputAnalysis11 analysis = new MethodCallThroughputAnalysis11();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment14; package teetime.variant.methodcallWithPorts.examples.experiment14;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis14Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis14Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis14 analysis = new MethodCallThroughputAnalysis14(); final MethodCallThroughputAnalysis14 analysis = new MethodCallThroughputAnalysis14();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis14Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis14Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
***************************************************************************/ ***************************************************************************/
package teetime.variant.methodcallWithPorts.examples.experiment15; package teetime.variant.methodcallWithPorts.examples.experiment15;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis15Test extends PerformanceTest ...@@ -37,12 +32,10 @@ public class MethodCallThoughputTimestampAnalysis15Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
final MethodCallThroughputAnalysis15 analysis = new MethodCallThroughputAnalysis15(); final MethodCallThroughputAnalysis15 analysis = new MethodCallThroughputAnalysis15();
analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setNumNoopFilters(NUM_NOOP_FILTERS);
analysis.setTimestampObjects(timestampObjects); analysis.setTimestampObjects(this.timestampObjects);
analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() {
@Override @Override
public TimestampObject create() { public TimestampObject create() {
...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis15Test extends PerformanceTest ...@@ -51,14 +44,12 @@ public class MethodCallThoughputTimestampAnalysis15Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
} }
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects);
} }
} }
...@@ -22,7 +22,6 @@ import org.junit.Test; ...@@ -22,7 +22,6 @@ import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.ListUtil; import teetime.util.ListUtil;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -44,7 +43,6 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest ...@@ -44,7 +43,6 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest
private long performAnalysis(final int numThreads, final long durationWith1Thread) { private long performAnalysis(final int numThreads, final long durationWith1Thread) {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
final MethodCallThroughputAnalysis16 analysis = new MethodCallThroughputAnalysis16(); final MethodCallThroughputAnalysis16 analysis = new MethodCallThroughputAnalysis16();
analysis.setNumWorkerThreads(numThreads); analysis.setNumWorkerThreads(numThreads);
...@@ -57,23 +55,25 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest ...@@ -57,23 +55,25 @@ public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest
}); });
analysis.init(); analysis.init();
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
analysis.onTerminate(); analysis.onTerminate();
} }
// TODO refactor test
List<TimestampObject> timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList()); List<TimestampObject> timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList());
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects); StatisticsUtil.printStatistics(this.stopWatch.getDurationInNs(), timestampObjects);
if (durationWith1Thread != -1) { if (durationWith1Thread != -1) {
double speedup = (double) durationWith1Thread / stopWatch.getDurationInNs(); double speedup = (double) durationWith1Thread / this.stopWatch.getDurationInNs();
System.out.println("Speedup (from 1 to " + numThreads + " threads): " + String.format("%.2f", speedup)); System.out.println("Speedup (from 1 to " + numThreads + " threads): " + String.format("%.2f", speedup));
} }
return stopWatch.getDurationInNs(); return this.stopWatch.getDurationInNs();
} }
public static void main(final String[] args) { public static void main(final String[] args) {
......
...@@ -22,7 +22,6 @@ import org.junit.Test; ...@@ -22,7 +22,6 @@ import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.ListUtil; import teetime.util.ListUtil;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest; import test.PerformanceTest;
...@@ -37,7 +36,6 @@ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest ...@@ -37,7 +36,6 @@ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest
public void testWithManyObjects() { public void testWithManyObjects() {
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="
+ NUM_NOOP_FILTERS + "..."); + NUM_NOOP_FILTERS + "...");
final StopWatch stopWatch = new StopWatch();
// int count = 10; // int count = 10;
// while (count-- > 0) { // while (count-- > 0) {
...@@ -52,16 +50,18 @@ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest ...@@ -52,16 +50,18 @@ public class MethodCallThoughputTimestampAnalysis17Test extends PerformanceTest
analysis.init(); analysis.init();
System.out.println("starting"); System.out.println("starting");
stopWatch.start(); this.stopWatch.start();
try { try {
analysis.start(); analysis.start();
} finally { } finally {
stopWatch.end(); this.stopWatch.end();
analysis.onTerminate(); analysis.onTerminate();
} }
// TODO refactor test
List<TimestampObject> timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList()); List<TimestampObject> timestampObjects = ListUtil.merge(analysis.getTimestampObjectsList());
StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects); StatisticsUtil.printStatistics(this.stopWatch.getDurationInNs(), timestampObjects);
// } // }
} }
} }
package test; package test;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import teetime.util.StatisticsUtil;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import kieker.common.logging.LogFactory; import kieker.common.logging.LogFactory;
...@@ -9,8 +21,32 @@ public abstract class PerformanceTest { ...@@ -9,8 +21,32 @@ public abstract class PerformanceTest {
protected static final int NUM_OBJECTS_TO_CREATE = 100000; protected static final int NUM_OBJECTS_TO_CREATE = 100000;
protected static final int NUM_NOOP_FILTERS = 800; protected static final int NUM_NOOP_FILTERS = 800;
private static MeasurementRepository measurementRepository = new MeasurementRepository();
private Description description;
protected StopWatch stopWatch;
protected List<TimestampObject> timestampObjects;
@Rule
public final TestRule watcher = new TestWatcher() {
@Override
protected void starting(final Description description) {
PerformanceTest.this.description = description;
// System.out.println("getDisplayName(): " + description.getDisplayName());
}
};
@Before @Before
public void before() { public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE"); System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
this.stopWatch = new StopWatch();
this.timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
}
@After
public void after() {
PerformanceResult performanceResult = StatisticsUtil.printStatistics(this.stopWatch.getDurationInNs(), this.timestampObjects);
measurementRepository.performanceResults.put(this.description.getDisplayName(), performanceResult);
} }
} }
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment