From 560d2e269faac15494ac51f701552cd37f63ccd8 Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Sun, 15 Jun 2014 00:36:25 +0200 Subject: [PATCH] added more performance tests --- ...dCallThoughputTimestampAnalysis1Test.java} | 6 +- ...odCallThoughputTimestampAnalysis3Test.java | 77 ++++++++++ ...odCallThoughputTimestampAnalysis4Test.java | 77 ++++++++++ .../throughput/methodcall/CollectorSink.java | 9 +- ...ava => MethodCallThroughputAnalysis1.java} | 6 +- .../MethodCallThroughputAnalysis2.java | 8 +- .../MethodCallThroughputAnalysis3.java | 134 ++++++++++++++++++ .../MethodCallThroughputAnalysis4.java | 130 +++++++++++++++++ .../throughput/methodcall/NoopFilter.java | 5 +- .../throughput/methodcall/ObjectProducer.java | 3 +- .../throughput/methodcall/Pipeline.java | 5 + .../examples/throughput/methodcall/Stage.java | 2 + .../methodcall/StartTimestampFilter.java | 8 +- .../methodcall/StopTimestampFilter.java | 8 +- 14 files changed, 456 insertions(+), 22 deletions(-) rename src/test/java/teetime/examples/throughput/{MethodCallThoughputTimestampAnalysisTest.java => MethodCallThoughputTimestampAnalysis1Test.java} (93%) create mode 100644 src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis3Test.java create mode 100644 src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis4Test.java rename src/test/java/teetime/examples/throughput/methodcall/{MethodCallThroughputAnalysis.java => MethodCallThroughputAnalysis1.java} (96%) create mode 100644 src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis3.java create mode 100644 src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis4.java diff --git a/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysisTest.java b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis1Test.java similarity index 93% rename from src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysisTest.java rename to src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis1Test.java index f4a3e6e1..9ed23342 100644 --- a/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysisTest.java +++ b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis1Test.java @@ -22,7 +22,7 @@ import java.util.concurrent.Callable; import org.junit.Before; import org.junit.Test; -import teetime.examples.throughput.methodcall.MethodCallThroughputAnalysis; +import teetime.examples.throughput.methodcall.MethodCallThroughputAnalysis1; import teetime.util.StatisticsUtil; import teetime.util.StopWatch; @@ -33,7 +33,7 @@ import kieker.common.logging.LogFactory; * * @since 1.10 */ -public class MethodCallThoughputTimestampAnalysisTest { +public class MethodCallThoughputTimestampAnalysis1Test { private static final int NUM_OBJECTS_TO_CREATE = 100000; private static final int NUM_NOOP_FILTERS = 800; @@ -53,7 +53,7 @@ public class MethodCallThoughputTimestampAnalysisTest { final StopWatch stopWatch = new StopWatch(); final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE); - final MethodCallThroughputAnalysis analysis = new MethodCallThroughputAnalysis(); + final MethodCallThroughputAnalysis1 analysis = new MethodCallThroughputAnalysis1(); analysis.setNumNoopFilters(NUM_NOOP_FILTERS); analysis.setTimestampObjects(timestampObjects); analysis.setInput(NUM_OBJECTS_TO_CREATE, new Callable<TimestampObject>() { diff --git a/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis3Test.java b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis3Test.java new file mode 100644 index 00000000..6b4d7993 --- /dev/null +++ b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis3Test.java @@ -0,0 +1,77 @@ +/*************************************************************************** + * 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.throughput; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; + +import org.junit.Before; +import org.junit.Test; + +import teetime.examples.throughput.methodcall.MethodCallThroughputAnalysis3; +import teetime.util.StatisticsUtil; +import teetime.util.StopWatch; + +import kieker.common.logging.LogFactory; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class MethodCallThoughputTimestampAnalysis3Test { + + 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 + public void testWithManyObjects() { + System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", 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(); + analysis.setNumNoopFilters(NUM_NOOP_FILTERS); + analysis.setTimestampObjects(timestampObjects); + analysis.setInput(NUM_OBJECTS_TO_CREATE, new Callable<TimestampObject>() { + @Override + public TimestampObject call() throws Exception { + return new TimestampObject(); + } + }); + analysis.init(); + + stopWatch.start(); + try { + analysis.start(); + } finally { + stopWatch.end(); + } + + StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects); + } + +} diff --git a/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis4Test.java b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis4Test.java new file mode 100644 index 00000000..535ca153 --- /dev/null +++ b/src/test/java/teetime/examples/throughput/MethodCallThoughputTimestampAnalysis4Test.java @@ -0,0 +1,77 @@ +/*************************************************************************** + * 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.throughput; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; + +import org.junit.Before; +import org.junit.Test; + +import teetime.examples.throughput.methodcall.MethodCallThroughputAnalysis4; +import teetime.util.StatisticsUtil; +import teetime.util.StopWatch; + +import kieker.common.logging.LogFactory; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class MethodCallThoughputTimestampAnalysis4Test { + + 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 + public void testWithManyObjects() { + System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", 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(); + analysis.setNumNoopFilters(NUM_NOOP_FILTERS); + analysis.setTimestampObjects(timestampObjects); + analysis.setInput(NUM_OBJECTS_TO_CREATE, new Callable<TimestampObject>() { + @Override + public TimestampObject call() throws Exception { + return new TimestampObject(); + } + }); + analysis.init(); + + stopWatch.start(); + try { + analysis.start(); + } finally { + stopWatch.end(); + } + + StatisticsUtil.printStatistics(stopWatch.getDurationInNs(), timestampObjects); + } + +} diff --git a/src/test/java/teetime/examples/throughput/methodcall/CollectorSink.java b/src/test/java/teetime/examples/throughput/methodcall/CollectorSink.java index f8195ad7..785c6b6f 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/CollectorSink.java +++ b/src/test/java/teetime/examples/throughput/methodcall/CollectorSink.java @@ -24,9 +24,10 @@ import teetime.util.list.CommittableQueue; * * @since 1.10 */ -public class CollectorSink<T> extends ConsumerStage<T, Void> { +public class CollectorSink<T> extends ConsumerStage<T, Object> { private static final int THRESHOLD = 10000; + private static final Object continueSignal = new Object(); private final List<T> elements; @@ -37,11 +38,13 @@ public class CollectorSink<T> extends ConsumerStage<T, Void> { this.elements = list; } - public void execute(final T element) { - this.elements.add(element); + @Override + public Object execute(final Object element) { + this.elements.add((T) element); if ((this.elements.size() % THRESHOLD) == 0) { System.out.println("size: " + this.elements.size()); } + return continueSignal; } // @Override diff --git a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis.java b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis1.java similarity index 96% rename from src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis.java rename to src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis1.java index 69713940..f85dea67 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis.java +++ b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis1.java @@ -23,10 +23,10 @@ import teetime.framework.core.Analysis; /** * @author Christian Wulf - * + * * @since 1.10 */ -public class MethodCallThroughputAnalysis extends Analysis { +public class MethodCallThroughputAnalysis1 extends Analysis { private long numInputObjects; private Callable<TimestampObject> inputObjectCreator; @@ -60,7 +60,7 @@ public class MethodCallThroughputAnalysis extends Analysis { @Override public void run() { while (true) { - TimestampObject object = objectProducer.execute(); + TimestampObject object = objectProducer.execute(null); if (object == null) { return; } diff --git a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis2.java b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis2.java index 218db1bc..37e7beb1 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis2.java +++ b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis2.java @@ -58,13 +58,15 @@ public class MethodCallThroughputAnalysis2 extends Analysis { final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - final Pipeline<Void, Void> pipeline = new Pipeline<Void, Void>(); + final Pipeline<Void, Object> pipeline = new Pipeline<Void, Object>(); pipeline.setFirstStage(objectProducer); pipeline.addIntermediateStage(startTimestampFilter); pipeline.addIntermediateStages(noopFilters); pipeline.addIntermediateStage(stopTimestampFilter); pipeline.setLastStage(collectorSink); + pipeline.onStart(); + // pipeline.getInputPort().pipe = new Pipe<Void>(); // pipeline.getInputPort().pipe.add(new Object()); @@ -73,10 +75,8 @@ public class MethodCallThroughputAnalysis2 extends Analysis { final Runnable runnable = new Runnable() { @Override public void run() { - pipeline.onStart(); - CommittableQueue<Void> inputQueue = new CommittableResizableArrayQueue<Void>(null, 0); - CommittableQueue<Void> outputQueue = new CommittableResizableArrayQueue<Void>(null, 0); + CommittableQueue<Object> outputQueue = new CommittableResizableArrayQueue<Object>(null, 0); while (pipeline.getSchedulingInformation().isActive()) { outputQueue = pipeline.execute2(inputQueue); diff --git a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis3.java b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis3.java new file mode 100644 index 00000000..4f98f4c7 --- /dev/null +++ b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis3.java @@ -0,0 +1,134 @@ +/*************************************************************************** + * 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.throughput.methodcall; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.Callable; + +import teetime.examples.throughput.TimestampObject; +import teetime.framework.core.Analysis; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class MethodCallThroughputAnalysis3 extends Analysis { + + public abstract class WrappingPipeline { + + public abstract boolean execute(); + + } + + private long numInputObjects; + private Callable<TimestampObject> inputObjectCreator; + private int numNoopFilters; + private List<TimestampObject> timestampObjects; + private Runnable runnable; + + @Override + public void init() { + super.init(); + 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 List<Stage> stageList = new ArrayList<Stage>(); + stageList.add(objectProducer); + stageList.add(startTimestampFilter); + stageList.addAll(Arrays.asList(noopFilters)); + stageList.add(stopTimestampFilter); + stageList.add(collectorSink); + + // using an array decreases the performance from 60ms to 200ms (by 3x) + final Stage[] stages = stageList.toArray(new Stage[0]); + + final WrappingPipeline pipeline = new WrappingPipeline() { + @Override + public boolean execute() { + // extracting the null-check does NOT improve performance + Stage stage = stages[0]; + Object element = stage.execute(null); + if (element == null) { + return false; + } + + for (int i = 1; i < stages.length; i++) { + stage = stages[i]; + element = stage.execute(element); + } + return true; + } + + }; + + final Runnable runnable = new Runnable() { + @Override + public void run() { + boolean success; + do { + success = pipeline.execute(); + } while (success); + } + }; + return runnable; + } + + @Override + public void start() { + super.start(); + this.runnable.run(); + } + + public void setInput(final int numInputObjects, final Callable<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<TimestampObject> getTimestampObjects() { + return this.timestampObjects; + } + + public void setTimestampObjects(final List<TimestampObject> timestampObjects) { + this.timestampObjects = timestampObjects; + } +} diff --git a/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis4.java b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis4.java new file mode 100644 index 00000000..bb17235f --- /dev/null +++ b/src/test/java/teetime/examples/throughput/methodcall/MethodCallThroughputAnalysis4.java @@ -0,0 +1,130 @@ +/*************************************************************************** + * 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.throughput.methodcall; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.Callable; + +import teetime.examples.throughput.TimestampObject; +import teetime.framework.core.Analysis; + +/** + * @author Christian Wulf + * + * @since 1.10 + */ +public class MethodCallThroughputAnalysis4 extends Analysis { + + public abstract class WrappingPipeline { + + public abstract boolean execute(); + + } + + private long numInputObjects; + private Callable<TimestampObject> inputObjectCreator; + private int numNoopFilters; + private List<TimestampObject> timestampObjects; + private Runnable runnable; + + @Override + public void init() { + super.init(); + 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); + + List<Stage> stages = new ArrayList<Stage>(); + stages.add(objectProducer); + stages.add(startTimestampFilter); + stages.addAll(Arrays.asList(noopFilters)); + stages.add(stopTimestampFilter); + stages.add(collectorSink); + + final WrappingPipeline pipeline = new WrappingPipeline() { + @Override + public boolean execute() { + TimestampObject object = objectProducer.execute(null); + if (object == null) { + return false; + } + object = startTimestampFilter.execute(object); + for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { + object = noopFilter.execute(object); + } + object = stopTimestampFilter.execute(object); + collectorSink.execute(object); + return true; + } + + }; + + final Runnable runnable = new Runnable() { + @Override + public void run() { + boolean success; + do { + success = pipeline.execute(); + } while (success); + } + }; + return runnable; + } + + @Override + public void start() { + super.start(); + this.runnable.run(); + } + + public void setInput(final int numInputObjects, final Callable<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<TimestampObject> getTimestampObjects() { + return this.timestampObjects; + } + + public void setTimestampObjects(final List<TimestampObject> timestampObjects) { + this.timestampObjects = timestampObjects; + } +} diff --git a/src/test/java/teetime/examples/throughput/methodcall/NoopFilter.java b/src/test/java/teetime/examples/throughput/methodcall/NoopFilter.java index 896de27d..a62cdbe4 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/NoopFilter.java +++ b/src/test/java/teetime/examples/throughput/methodcall/NoopFilter.java @@ -24,8 +24,9 @@ import teetime.util.list.CommittableQueue; */ public class NoopFilter<T> extends ConsumerStage<T, T> { - public T execute(final T obj) { - return obj; + @Override + public T execute(final Object obj) { + return (T) obj; } // @Override diff --git a/src/test/java/teetime/examples/throughput/methodcall/ObjectProducer.java b/src/test/java/teetime/examples/throughput/methodcall/ObjectProducer.java index 96424548..7c4199d2 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/ObjectProducer.java +++ b/src/test/java/teetime/examples/throughput/methodcall/ObjectProducer.java @@ -37,7 +37,8 @@ public class ObjectProducer<T> extends ProducerStage<Void, T> { this.inputObjectCreator = inputObjectCreator; } - public T execute() { + @Override + public T execute(final Object element) { if (this.numInputObjects == 0) { return null; } diff --git a/src/test/java/teetime/examples/throughput/methodcall/Pipeline.java b/src/test/java/teetime/examples/throughput/methodcall/Pipeline.java index d44a9160..975f9e00 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/Pipeline.java +++ b/src/test/java/teetime/examples/throughput/methodcall/Pipeline.java @@ -141,6 +141,11 @@ public class Pipeline<I, O> implements Stage<I, O>, OnDisableListener { this.listener = listener; } + @Override + public O execute(final Object element) { + throw new IllegalStateException(); + } + // @Override // public OutputPort getOutputPort() { // return this.lastStage.getOutputPort(); diff --git a/src/test/java/teetime/examples/throughput/methodcall/Stage.java b/src/test/java/teetime/examples/throughput/methodcall/Stage.java index 35f78cd3..d9e39724 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/Stage.java +++ b/src/test/java/teetime/examples/throughput/methodcall/Stage.java @@ -6,6 +6,8 @@ public interface Stage<I, O> { public static final Object END_SIGNAL = new Object(); + O execute(Object element); + // CommittableQueue<O> execute2(); // InputPort<I> getInputPort(); diff --git a/src/test/java/teetime/examples/throughput/methodcall/StartTimestampFilter.java b/src/test/java/teetime/examples/throughput/methodcall/StartTimestampFilter.java index 9e818304..672af104 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/StartTimestampFilter.java +++ b/src/test/java/teetime/examples/throughput/methodcall/StartTimestampFilter.java @@ -25,9 +25,11 @@ import teetime.util.list.CommittableQueue; */ public class StartTimestampFilter extends ConsumerStage<TimestampObject, TimestampObject> { - public TimestampObject execute(final TimestampObject obj) { - obj.setStartTimestamp(System.nanoTime()); - return obj; + @Override + public TimestampObject execute(final Object obj) { + TimestampObject timestampObject = (TimestampObject) obj; + timestampObject.setStartTimestamp(System.nanoTime()); + return timestampObject; } // @Override diff --git a/src/test/java/teetime/examples/throughput/methodcall/StopTimestampFilter.java b/src/test/java/teetime/examples/throughput/methodcall/StopTimestampFilter.java index ee5b3baa..d1338b40 100644 --- a/src/test/java/teetime/examples/throughput/methodcall/StopTimestampFilter.java +++ b/src/test/java/teetime/examples/throughput/methodcall/StopTimestampFilter.java @@ -25,9 +25,11 @@ import teetime.util.list.CommittableQueue; */ public class StopTimestampFilter extends ConsumerStage<TimestampObject, TimestampObject> { - public TimestampObject execute(final TimestampObject obj) { - obj.setStopTimestamp(System.nanoTime()); - return obj; + @Override + public TimestampObject execute(final Object obj) { + TimestampObject timestampObject = (TimestampObject) obj; + timestampObject.setStopTimestamp(System.nanoTime()); + return timestampObject; } // @Override -- GitLab