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 f4a3e6e1e6844aab85a8dc9cd97c044485fa2b31..9ed23342f1aecc29668ae4c066e44047d0016efd 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 0000000000000000000000000000000000000000..6b4d7993ec2022dc237623bfdabc0def84b58433 --- /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 0000000000000000000000000000000000000000..535ca15327005f4721517a3b151b9cabfc06552d --- /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 f8195ad72c01ed28b7ff4f1157d37c5876a3f06f..785c6b6fc7c41c114bad65097f7875f87b52a2a0 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 6971394015cc52c6f4dfa80436894331e0e898b7..f85dea6775b32b6c6569b0ac70b8be11a902e529 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 218db1bc1f09503537563f6e7f2bdac7a84cebc6..37e7beb10b9a622bfb3d283f693b439dd7906513 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 0000000000000000000000000000000000000000..4f98f4c760ea3814ee1e2828ea39fd007f68e3cd --- /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 0000000000000000000000000000000000000000..bb17235f4a90ecd085a9ac51a9973f461cd860f8 --- /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 896de27db5e452a01cfdf95253a98545d6d19a7e..a62cdbe4eefc333d5aff2620b7a879f4c643343e 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 96424548e974bcb4876a8d8f5d745f117d049927..7c4199d271d26f097ffd080ff89673e967d6aa1a 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 d44a91600c931915fac507c3ec003378649c9011..975f9e0092b1aec1296b806c4c66d0099948e8d0 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 35f78cd3a87964447826b2b32dcd5c465482bd31..d9e397246beeeeb54d27e57e23908b78698489c6 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 9e818304402d350f0da834a2141d6e8438a94dad..672af104bcab928334390ea0542796f36884b40d 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 ee5b3baa0141287d3ba87de4cc977d75e8e263fa..d1338b401e9a70c597a6edda62ee2110048a9265 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