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

refactored all tests to PerformanceTests;

added MeasurementRepository
parent b0b81661
Branches
Tags
No related merge requests found
Showing
with 51 additions and 184 deletions
...@@ -9,8 +9,6 @@ public abstract class AbstractStage<I, O> implements Stage<I, O> { ...@@ -9,8 +9,6 @@ public abstract class AbstractStage<I, O> implements Stage<I, O> {
private Stage<?, ?> parentStage; private Stage<?, ?> parentStage;
private int index;
private Stage<?, ?> successor; private Stage<?, ?> successor;
private boolean reschedulable; private boolean reschedulable;
...@@ -73,7 +71,6 @@ public abstract class AbstractStage<I, O> implements Stage<I, O> { ...@@ -73,7 +71,6 @@ public abstract class AbstractStage<I, O> implements Stage<I, O> {
@Override @Override
public void setParentStage(final Stage<?, ?> parentStage, final int index) { public void setParentStage(final Stage<?, ?> parentStage, final int index) {
this.index = index;
this.parentStage = parentStage; this.parentStage = parentStage;
} }
......
...@@ -142,13 +142,13 @@ public class Pipeline<I, O> implements Stage<I, O> { ...@@ -142,13 +142,13 @@ public class Pipeline<I, O> implements Stage<I, O> {
throw new IllegalStateException(); throw new IllegalStateException();
} }
public void setReschedulable(final boolean reschedulable) {
this.reschedulable = reschedulable;
}
@Override @Override
public boolean isReschedulable() { public boolean isReschedulable() {
return this.reschedulable; return this.reschedulable;
} }
public void setReschedulable(final boolean reschedulable) {
this.reschedulable = reschedulable;
}
} }
...@@ -24,6 +24,11 @@ public interface Stage<I, O> { ...@@ -24,6 +24,11 @@ public interface Stage<I, O> {
void setSuccessor(Stage<? super O, ?> successor); void setSuccessor(Stage<? super O, ?> successor);
/**
* Used for execute4() (experiment02)
*
* @return
*/
boolean isReschedulable(); boolean isReschedulable();
void onIsPipelineHead(); void onIsPipelineHead();
......
...@@ -15,7 +15,7 @@ public class EndStage<T> implements Stage<T, T> { ...@@ -15,7 +15,7 @@ public class EndStage<T> implements Stage<T, T> {
@Override @Override
public T execute(final Object element) { public T execute(final Object element) {
return null; throw new IllegalStateException();
} }
@Override @Override
...@@ -43,7 +43,6 @@ public class EndStage<T> implements Stage<T, T> { ...@@ -43,7 +43,6 @@ public class EndStage<T> implements Stage<T, T> {
@Override @Override
public Stage next() { public Stage next() {
// TODO Auto-generated method stub
return null; return null;
} }
...@@ -53,11 +52,6 @@ public class EndStage<T> implements Stage<T, T> { ...@@ -53,11 +52,6 @@ public class EndStage<T> implements Stage<T, T> {
} }
@Override
public boolean isReschedulable() {
return false;
}
@Override @Override
public void onStart() { public void onStart() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -66,8 +60,12 @@ public class EndStage<T> implements Stage<T, T> { ...@@ -66,8 +60,12 @@ public class EndStage<T> implements Stage<T, T> {
@Override @Override
public Object executeRecursively(final Object element) { public Object executeRecursively(final Object element) {
// TODO Auto-generated method stub return element;
return null; }
@Override
public boolean isReschedulable() {
return false;
} }
} }
...@@ -39,20 +39,15 @@ public class ObjectProducer<T> extends ProducerStage<Void, T> { ...@@ -39,20 +39,15 @@ public class ObjectProducer<T> extends ProducerStage<Void, T> {
@Override @Override
public T execute(final Object element) { public T execute(final Object element) {
// if (this.numInputObjects == 0) { if (this.numInputObjects == 0) {
// // this.setReschedulable(false); return null;
// return null; }
// }
try { try {
final T newObject = this.inputObjectCreator.create(); final T newObject = this.inputObjectCreator.create();
// final T newObject = null; // final T newObject = null;
this.numInputObjects--; this.numInputObjects--;
if (this.numInputObjects == 0) {
this.setReschedulable(false);
}
return newObject; return newObject;
} catch (final Exception e) { } catch (final Exception e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
......
...@@ -19,32 +19,22 @@ import java.util.ArrayList; ...@@ -19,32 +19,22 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import kieker.analysis.examples.ThroughputTimestampAnalysis;
import kieker.analysis.exception.AnalysisConfigurationException;
import kieker.common.logging.LogFactory;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.analysis.examples.ThroughputTimestampAnalysis;
import kieker.analysis.exception.AnalysisConfigurationException;
/** /**
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
* *
* @since 1.10 * @since 1.10
*/ */
public class ThroughputTimestampAnalysisTest { public class ThroughputTimestampAnalysisTest extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithManyObjects() throws IllegalStateException, AnalysisConfigurationException { public void testWithManyObjects() throws IllegalStateException, AnalysisConfigurationException {
......
...@@ -17,29 +17,20 @@ package teetime.variant.explicitScheduling.examples.throughput; ...@@ -17,29 +17,20 @@ package teetime.variant.explicitScheduling.examples.throughput;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import kieker.common.logging.LogFactory;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.ThroughputAnalysis; import test.PerformanceTest;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class ThroughputAnalysisTest { public class ThroughputAnalysisTest extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int numRuns = 2; private static final int numRuns = 2;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithMultipleRuns() { public void testWithMultipleRuns() {
final StopWatch stopWatch = new StopWatch(); final StopWatch stopWatch = new StopWatch();
......
...@@ -19,30 +19,18 @@ import java.util.ArrayList; ...@@ -19,30 +19,18 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.ThroughputTimestampAnalysis; import test.PerformanceTest;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class ThroughputTimestampAnalysisTest { public class ThroughputTimestampAnalysisTest extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment01; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment01;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis1Test { public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework // 500 times faster than our new framework
// TODO check why // TODO check why
......
...@@ -65,12 +65,10 @@ public class MethodCallThroughputAnalysis1 extends Analysis { ...@@ -65,12 +65,10 @@ public class MethodCallThroughputAnalysis1 extends Analysis {
@Override @Override
public void run() { public void run() {
while (true) { while (true) {
if (!objectProducer.isReschedulable()) { TimestampObject object = objectProducer.execute(null);
if (object == null) {
return; return;
} }
TimestampObject object = objectProducer.execute(null);
// if (object == null)
// return;
object = startTimestampFilter.execute(object); object = startTimestampFilter.execute(object);
for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { for (final NoopFilter<TimestampObject> noopFilter : noopFilters) {
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment02; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment02;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis2Test { public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework // 500 times faster than our new framework
// TODO check why // TODO check why
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment03; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment03;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis3Test { public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework // 500 times faster than our new framework
// TODO check why // TODO check why
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment04; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment04;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis4Test { public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework // 500 times faster than our new framework
// TODO check why // TODO check why
......
...@@ -58,8 +58,8 @@ public class MethodCallThroughputAnalysis5 extends Analysis { ...@@ -58,8 +58,8 @@ public class MethodCallThroughputAnalysis5 extends Analysis {
* @param numNoopFilters * @param numNoopFilters
* @since 1.10 * @since 1.10
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" })
private Runnable buildPipeline() { private Runnable buildPipeline() {
@SuppressWarnings("unchecked")
final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters];
// create stages // create stages
final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator);
......
...@@ -18,33 +18,20 @@ package teetime.variant.methodcall.examples.experiment06; ...@@ -18,33 +18,20 @@ package teetime.variant.methodcall.examples.experiment06;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis6Test { public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework
// TODO check why
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
...@@ -18,33 +18,20 @@ package teetime.variant.methodcall.examples.experiment07; ...@@ -18,33 +18,20 @@ package teetime.variant.methodcall.examples.experiment07;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis7Test { public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
// 500 times faster than our new framework
// TODO check why
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
...@@ -58,6 +58,7 @@ public class MethodCallThroughputAnalysis7 extends Analysis { ...@@ -58,6 +58,7 @@ public class MethodCallThroughputAnalysis7 extends Analysis {
* @param numNoopFilters * @param numNoopFilters
* @since 1.10 * @since 1.10
*/ */
@SuppressWarnings("rawtypes")
private Runnable buildPipeline() { private Runnable buildPipeline() {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters];
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment08; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment08;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis8Test { public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment12; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment12;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis12Test { public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment13; ...@@ -18,30 +18,20 @@ package teetime.variant.methodcall.examples.experiment13;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import teetime.util.ConstructorClosure; import teetime.util.ConstructorClosure;
import teetime.util.StatisticsUtil; import teetime.util.StatisticsUtil;
import teetime.util.StopWatch; import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import test.PerformanceTest;
import kieker.common.logging.LogFactory;
/** /**
* @author Christian Wulf * @author Christian Wulf
* *
* @since 1.10 * @since 1.10
*/ */
public class MethodCallThoughputTimestampAnalysis13Test { public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest {
private static final int NUM_OBJECTS_TO_CREATE = 100000;
private static final int NUM_NOOP_FILTERS = 800;
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
}
@Test @Test
public void testWithManyObjects() { public void testWithManyObjects() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment