From 0a6a747c1d236431dfb775649eb39033649cb988 Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nils@rhocas.de>
Date: Tue, 24 Mar 2015 20:09:56 +0100
Subject: [PATCH] Added the timestamps to the operation calls and displayed
 them in column

---
 .../diagnosis/domain/OperationCall.java       | 23 ++++++++-----
 .../stages/LegacyTraceReconstructor.java      |  5 +--
 .../importer/stages/TraceReconstructor.java   |  6 ++--
 .../kieker/diagnosis/subview/calls/View.java  |  9 ++++-
 .../calls/util/TimestampSortListener.java     | 31 +++++++++++++++++
 .../kieker/diagnosis/subview/traces/View.java | 10 ++++--
 .../traces/util/TimestampSortListener.java    | 34 +++++++++++++++++++
 .../domain/AggregatedOperationCallTest.java   | 14 ++++----
 .../diagnosis/domain/OperationCallTest.java   | 15 ++++----
 ...ggregatedTraceStatisticsDecoratorTest.java |  7 ++--
 .../stages/LegacyTraceReconstructorTest.java  |  2 +-
 .../stages/TraceStatisticsDecoratorTest.java  | 33 +++++++++---------
 12 files changed, 135 insertions(+), 54 deletions(-)
 create mode 100644 src/main/java/kieker/diagnosis/subview/calls/util/TimestampSortListener.java
 create mode 100644 src/main/java/kieker/diagnosis/subview/traces/util/TimestampSortListener.java

diff --git a/src/main/java/kieker/diagnosis/domain/OperationCall.java b/src/main/java/kieker/diagnosis/domain/OperationCall.java
index 5d87b221..14bbb4df 100644
--- a/src/main/java/kieker/diagnosis/domain/OperationCall.java
+++ b/src/main/java/kieker/diagnosis/domain/OperationCall.java
@@ -17,9 +17,10 @@
 package kieker.diagnosis.domain;
 
 /**
- * This class represents a concrete operation call within this application. It adds some properties that are only required for concrete operation calls, like the trace ID and the
+ * This class represents a concrete operation call within this application. It adds some properties that are only required for concrete operation calls, like the
+ * trace ID and the
  * duration. It extends the call tree mechanism (inherited from {@link AbstractOperationCall}) by a parent, allowing to navigate in both directions within the tree.
- *
+ * 
  * @author Nils Christian Ehmke
  */
 public final class OperationCall extends AbstractOperationCall<OperationCall> {
@@ -29,15 +30,13 @@ public final class OperationCall extends AbstractOperationCall<OperationCall> {
 	private OperationCall parent;
 	private float percent;
 	private long duration;
+	private long timestamp;
 
-	public OperationCall(final String container, final String component, final String operation, final long traceID) {
-		this(container, component, operation, traceID, null);
-	}
-
-	public OperationCall(final String container, final String component, final String operation, final long traceID, final String failedCause) {
-		super(container, component, operation, failedCause);
+	public OperationCall(final String container, final String component, final String operation, final long traceID, final long timestamp) {
+		super(container, component, operation, null);
 
 		this.traceID = traceID;
+		this.timestamp = timestamp;
 	}
 
 	@Override
@@ -70,4 +69,12 @@ public final class OperationCall extends AbstractOperationCall<OperationCall> {
 		return this.traceID;
 	}
 
+	public long getTimestamp() {
+		return timestamp;
+	}
+
+	public void setTimestamp(long timestamp) {
+		this.timestamp = timestamp;
+	}
+
 }
diff --git a/src/main/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructor.java b/src/main/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructor.java
index be2e0d7b..ed8ac1ff 100644
--- a/src/main/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructor.java
+++ b/src/main/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructor.java
@@ -82,10 +82,11 @@ final class LegacyTraceReconstructor extends AbstractStage<OperationExecutionRec
 			int ess = 0;
 			for (final OperationExecutionRecord record : this.records) {
 				final OperationCall newCall = new OperationCall(record.getHostname(), this.extractComponent(record.getOperationSignature()), record.getOperationSignature(),
-						this.traceID);
+						this.traceID, record.getLoggingTimestamp());
 				newCall.setDuration(record.getTout() - record.getTin());
 
-				// There can be "jumps" in the ess, as the operation execution records do not log the return jumps of methods. Therefore multiple of these jumps can be hidden.
+				// There can be "jumps" in the ess, as the operation execution records do not log the return jumps of methods. Therefore multiple of these jumps can
+				// be hidden.
 				int currentEss = record.getEss();
 				while ((currentEss <= ess) && (ess != 0)) {
 					header = header.getParent();
diff --git a/src/main/java/kieker/diagnosis/model/importer/stages/TraceReconstructor.java b/src/main/java/kieker/diagnosis/model/importer/stages/TraceReconstructor.java
index b497b239..69db2081 100644
--- a/src/main/java/kieker/diagnosis/model/importer/stages/TraceReconstructor.java
+++ b/src/main/java/kieker/diagnosis/model/importer/stages/TraceReconstructor.java
@@ -31,8 +31,8 @@ import kieker.diagnosis.domain.OperationCall;
 import kieker.diagnosis.domain.Trace;
 
 /**
- * Reconstruct traces based on the incoming instances of {@code IFlowRecord}. Currently only {@link TraceMetadata}, {@link BeforeOperationEvent} and {@link AfterOperationEvent}
- * instances are supported.
+ * Reconstruct traces based on the incoming instances of {@code IFlowRecord}. Currently only {@link TraceMetadata}, {@link BeforeOperationEvent} and
+ * {@link AfterOperationEvent} instances are supported.
  * 
  * @author Nils Christian Ehmke
  */
@@ -91,7 +91,7 @@ final class TraceReconstructor extends AbstractStage<IFlowRecord, Trace> {
 		private void handleBeforeOperationEventRecord(final BeforeOperationEvent record) {
 			this.stack.push(record);
 
-			final OperationCall newCall = new OperationCall(this.hostname, record.getClassSignature(), record.getOperationSignature(), this.traceID);
+			final OperationCall newCall = new OperationCall(this.hostname, record.getClassSignature(), record.getOperationSignature(), this.traceID, record.getLoggingTimestamp());
 			if (this.root == null) {
 				this.root = newCall;
 			} else {
diff --git a/src/main/java/kieker/diagnosis/subview/calls/View.java b/src/main/java/kieker/diagnosis/subview/calls/View.java
index ef661704..9f4f8fc4 100644
--- a/src/main/java/kieker/diagnosis/subview/calls/View.java
+++ b/src/main/java/kieker/diagnosis/subview/calls/View.java
@@ -29,6 +29,7 @@ import kieker.diagnosis.subview.calls.util.ComponentSortListener;
 import kieker.diagnosis.subview.calls.util.ContainerSortListener;
 import kieker.diagnosis.subview.calls.util.DurationSortListener;
 import kieker.diagnosis.subview.calls.util.OperationSortListener;
+import kieker.diagnosis.subview.calls.util.TimestampSortListener;
 import kieker.diagnosis.subview.calls.util.TraceIDSortListener;
 import kieker.diagnosis.subview.util.IModel;
 import kieker.diagnosis.subview.util.NameConverter;
@@ -122,6 +123,10 @@ public final class View implements ISubView, Observer {
 		tblclmnTotalDuration.setWidth(100);
 		tblclmnTotalDuration.setText("Trace ID");
 
+		final TableColumn tblclmnTimestamp = new TableColumn(this.table, SWT.NONE);
+		tblclmnTimestamp.setWidth(100);
+		tblclmnTimestamp.setText("Timestamp");
+
 		this.detailComposite = new Composite(sashForm, SWT.BORDER);
 		this.detailComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
 		this.detailComposite.setLayout(new GridLayout(2, false));
@@ -181,6 +186,7 @@ public final class View implements ISubView, Observer {
 		tblclmnOperation.addSelectionListener(new OperationSortListener());
 		tblclmnMinimalDuration.addSelectionListener(new DurationSortListener());
 		tblclmnTotalDuration.addSelectionListener(new TraceIDSortListener());
+		tblclmnTimestamp.addSelectionListener(new TimestampSortListener());
 	}
 
 	@Override
@@ -276,7 +282,8 @@ public final class View implements ISubView, Observer {
 			final String shortTimeUnit = NameConverter.toShortTimeUnit(View.this.propertiesModel.getTimeUnit());
 			final long duration = View.this.propertiesModel.getTimeUnit().convert(call.getDuration(), View.this.modelProxy.getSourceTimeUnit());
 
-			item.setText(new String[] { call.getContainer(), componentName, operationString, Long.toString(duration) + " " + shortTimeUnit, Long.toString(call.getTraceID()) });
+			item.setText(new String[] { call.getContainer(), componentName, operationString, Long.toString(duration) + " " + shortTimeUnit, Long.toString(call.getTraceID()),
+				Long.toString(call.getTimestamp()) });
 
 			if (call.isFailed()) {
 				final Color colorRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/TimestampSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/TimestampSortListener.java
new file mode 100644
index 00000000..73af3a3e
--- /dev/null
+++ b/src/main/java/kieker/diagnosis/subview/calls/util/TimestampSortListener.java
@@ -0,0 +1,31 @@
+/***************************************************************************
+ * Copyright 2015 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 kieker.diagnosis.subview.calls.util;
+
+import kieker.diagnosis.domain.OperationCall;
+import kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener;
+
+public final class TimestampSortListener extends AbstractCallTableColumnSortListener<OperationCall> {
+
+	private static final long serialVersionUID = 1L;
+
+	@Override
+	protected int compare(final OperationCall fstCall, final OperationCall sndCall) {
+		return Long.compare(fstCall.getTimestamp(), sndCall.getTimestamp());
+	}
+
+}
diff --git a/src/main/java/kieker/diagnosis/subview/traces/View.java b/src/main/java/kieker/diagnosis/subview/traces/View.java
index e9437303..4c0ffc4e 100644
--- a/src/main/java/kieker/diagnosis/subview/traces/View.java
+++ b/src/main/java/kieker/diagnosis/subview/traces/View.java
@@ -27,6 +27,7 @@ import kieker.diagnosis.model.PropertiesModel.ComponentNames;
 import kieker.diagnosis.model.PropertiesModel.OperationNames;
 import kieker.diagnosis.subview.ISubView;
 import kieker.diagnosis.subview.traces.util.DurationSortListener;
+import kieker.diagnosis.subview.traces.util.TimestampSortListener;
 import kieker.diagnosis.subview.traces.util.TraceIDSortListener;
 import kieker.diagnosis.subview.util.ComponentSortListener;
 import kieker.diagnosis.subview.util.ContainerSortListener;
@@ -136,10 +137,14 @@ public final class View implements Observer, ISubView {
 		trclmnPercent.setWidth(100);
 		trclmnPercent.setText("Percent");
 
-		final TreeColumn trclmnTraceId = new TreeColumn(this.tree, SWT.NONE);
+		final TreeColumn trclmnTraceId = new TreeColumn(this.tree, SWT.RIGHT);
 		trclmnTraceId.setWidth(100);
 		trclmnTraceId.setText("Trace ID");
 
+		final TreeColumn trclmnTimestamp = new TreeColumn(this.tree, SWT.NONE);
+		trclmnTimestamp.setWidth(100);
+		trclmnTimestamp.setText("Timestamp");
+
 		this.detailComposite = new Composite(sashForm, SWT.BORDER);
 		this.detailComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
 		this.detailComposite.setLayout(new GridLayout(2, false));
@@ -228,6 +233,7 @@ public final class View implements Observer, ISubView {
 		trclmnTraceId.addSelectionListener(new TraceIDSortListener());
 		trclmnTraceDepth.addSelectionListener(new TraceDepthSortListener());
 		trclmnTraceSize.addSelectionListener(new TraceSizeSortListener());
+		trclmnTimestamp.addSelectionListener(new TimestampSortListener());
 	}
 
 	public Tree getTree() {
@@ -343,7 +349,7 @@ public final class View implements Observer, ISubView {
 			final String durationString = duration + " " + shortTimeUnit;
 
 			item.setText(new String[] { call.getContainer(), componentName, operationString, Integer.toString(call.getStackDepth()), Integer.toString(call.getStackSize()),
-				durationString, String.format("%.1f%%", call.getPercent()), traceID });
+				durationString, String.format("%.1f%%", call.getPercent()), traceID, Long.toString(call.getTimestamp()) });
 
 			if (call.isFailed()) {
 				final Color colorRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
diff --git a/src/main/java/kieker/diagnosis/subview/traces/util/TimestampSortListener.java b/src/main/java/kieker/diagnosis/subview/traces/util/TimestampSortListener.java
new file mode 100644
index 00000000..f7c478a8
--- /dev/null
+++ b/src/main/java/kieker/diagnosis/subview/traces/util/TimestampSortListener.java
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright 2015 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 kieker.diagnosis.subview.traces.util;
+
+import kieker.diagnosis.domain.Trace;
+import kieker.diagnosis.subview.util.AbstractTraceTreeColumnSortListener;
+
+public final class TimestampSortListener extends AbstractTraceTreeColumnSortListener<Trace> {
+
+	private static final long serialVersionUID = 1L;
+
+	@Override
+	protected int compare(final Trace fstTrace, final Trace sndTrace) {
+		final long fstTimestamp = fstTrace.getRootOperationCall().getTimestamp();
+		final long sndTimestamp = sndTrace.getRootOperationCall().getTimestamp();
+
+		return Long.compare(fstTimestamp, sndTimestamp);
+	}
+
+}
diff --git a/src/test/java/kieker/diagnosis/domain/AggregatedOperationCallTest.java b/src/test/java/kieker/diagnosis/domain/AggregatedOperationCallTest.java
index 7ffb7230..cae9a82a 100644
--- a/src/test/java/kieker/diagnosis/domain/AggregatedOperationCallTest.java
+++ b/src/test/java/kieker/diagnosis/domain/AggregatedOperationCallTest.java
@@ -18,8 +18,6 @@ package kieker.diagnosis.domain;
 
 import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
-import kieker.diagnosis.domain.AggregatedOperationCall;
-import kieker.diagnosis.domain.OperationCall;
 
 import org.junit.Test;
 
@@ -27,7 +25,7 @@ public final class AggregatedOperationCallTest extends AbstractOperationCallTest
 
 	@Test
 	public void constructorShouldCopySingleOperationCall() {
-		final OperationCall call = new OperationCall("container", "component", "operation", 42);
+		final OperationCall call = new OperationCall("container", "component", "operation", 42, 0);
 		final AggregatedOperationCall aggregatedCall = new AggregatedOperationCall(call);
 
 		assertThat(aggregatedCall.getContainer(), is("container"));
@@ -37,9 +35,9 @@ public final class AggregatedOperationCallTest extends AbstractOperationCallTest
 
 	@Test
 	public void constructorShouldCopyNestedOperationCall() {
-		final OperationCall call = new OperationCall("container", "component", "operation", 42);
-		call.addChild(new OperationCall("container1", "component1", "operation1", 42));
-		call.addChild(new OperationCall("container2", "component2", "operation2", 42));
+		final OperationCall call = new OperationCall("container", "component", "operation", 42, 0);
+		call.addChild(new OperationCall("container1", "component1", "operation1", 42, 0));
+		call.addChild(new OperationCall("container2", "component2", "operation2", 42, 0));
 
 		final AggregatedOperationCall aggregatedCall = new AggregatedOperationCall(call);
 
@@ -58,7 +56,7 @@ public final class AggregatedOperationCallTest extends AbstractOperationCallTest
 
 	@Test
 	public void constructorShouldCopyStatistics() {
-		final OperationCall call = new OperationCall("container", "component", "operation", 42);
+		final OperationCall call = new OperationCall("container", "component", "operation", 42, 0);
 		call.setStackSize(1);
 
 		final AggregatedOperationCall aggregatedCall = new AggregatedOperationCall(call);
@@ -68,7 +66,7 @@ public final class AggregatedOperationCallTest extends AbstractOperationCallTest
 
 	@Override
 	protected AggregatedOperationCall createOperationCall(final String container, final String component, final String operation) {
-		return new AggregatedOperationCall(new OperationCall(container, component, operation, -1));
+		return new AggregatedOperationCall(new OperationCall(container, component, operation, -1, 0));
 	}
 
 }
diff --git a/src/test/java/kieker/diagnosis/domain/OperationCallTest.java b/src/test/java/kieker/diagnosis/domain/OperationCallTest.java
index 7973d57e..fe6b0758 100644
--- a/src/test/java/kieker/diagnosis/domain/OperationCallTest.java
+++ b/src/test/java/kieker/diagnosis/domain/OperationCallTest.java
@@ -19,7 +19,6 @@ package kieker.diagnosis.domain;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.core.IsEqual.equalTo;
 import static org.junit.Assert.assertThat;
-import kieker.diagnosis.domain.OperationCall;
 
 import org.junit.Test;
 
@@ -27,8 +26,8 @@ public final class OperationCallTest extends AbstractOperationCallTest<Operation
 
 	@Test
 	public void addingChildrenShouldUpdateTheParent() {
-		final OperationCall call = new OperationCall("", "", "", 42);
-		final OperationCall child = new OperationCall("", "", "", 42);
+		final OperationCall call = new OperationCall("", "", "", 42, 0);
+		final OperationCall child = new OperationCall("", "", "", 42, 0);
 
 		call.addChild(child);
 
@@ -37,16 +36,16 @@ public final class OperationCallTest extends AbstractOperationCallTest<Operation
 
 	@Test
 	public void equalsForDifferentTIDsShouldWork() {
-		final OperationCall fstCall = new OperationCall("container", "component", "operation", 42);
-		final OperationCall sndCall = new OperationCall("container", "component", "operation", 43);
+		final OperationCall fstCall = new OperationCall("container", "component", "operation", 42, 0);
+		final OperationCall sndCall = new OperationCall("container", "component", "operation", 43, 0);
 
 		assertThat(fstCall, is(equalTo(sndCall)));
 	}
 
 	@Test
 	public void equalsForDifferentDurationsShouldWork() {
-		final OperationCall fstCall = new OperationCall("container", "component", "operation", 42);
-		final OperationCall sndCall = new OperationCall("container", "component", "operation", 42);
+		final OperationCall fstCall = new OperationCall("container", "component", "operation", 42, 0);
+		final OperationCall sndCall = new OperationCall("container", "component", "operation", 42, 0);
 
 		fstCall.setDuration(100);
 		sndCall.setDuration(200);
@@ -56,7 +55,7 @@ public final class OperationCallTest extends AbstractOperationCallTest<Operation
 
 	@Override
 	protected OperationCall createOperationCall(final String container, final String component, final String operation) {
-		return new OperationCall(container, component, operation, -1);
+		return new OperationCall(container, component, operation, -1, 0);
 	}
 
 }
diff --git a/src/test/java/kieker/diagnosis/model/importer/stages/AggregatedTraceStatisticsDecoratorTest.java b/src/test/java/kieker/diagnosis/model/importer/stages/AggregatedTraceStatisticsDecoratorTest.java
index f7c6167a..279ef59b 100644
--- a/src/test/java/kieker/diagnosis/model/importer/stages/AggregatedTraceStatisticsDecoratorTest.java
+++ b/src/test/java/kieker/diagnosis/model/importer/stages/AggregatedTraceStatisticsDecoratorTest.java
@@ -24,7 +24,6 @@ import java.util.Arrays;
 import kieker.diagnosis.domain.AggregatedTrace;
 import kieker.diagnosis.domain.OperationCall;
 import kieker.diagnosis.domain.Trace;
-import kieker.diagnosis.model.importer.stages.AggregatedTraceStatisticsDecorator;
 
 import org.junit.Test;
 
@@ -32,9 +31,9 @@ public final class AggregatedTraceStatisticsDecoratorTest {
 
 	@Test
 	public void minMaxMeanAndAvgCalculationForSingleCallShouldWork() throws Exception {
-		final OperationCall call1 = new OperationCall("", "", "", 43);
-		final OperationCall call2 = new OperationCall("", "", "", 44);
-		final OperationCall call3 = new OperationCall("", "", "", 45);
+		final OperationCall call1 = new OperationCall("", "", "", 43, 0);
+		final OperationCall call2 = new OperationCall("", "", "", 44, 0);
+		final OperationCall call3 = new OperationCall("", "", "", 45, 0);
 
 		call1.setDuration(15);
 		call2.setDuration(7);
diff --git a/src/test/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructorTest.java b/src/test/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructorTest.java
index 2640bc39..bf4c3aba 100644
--- a/src/test/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructorTest.java
+++ b/src/test/java/kieker/diagnosis/model/importer/stages/LegacyTraceReconstructorTest.java
@@ -132,7 +132,7 @@ public class LegacyTraceReconstructorTest {
 			final IPipeFactory pipeFactory = new SingleElementPipeFactory();
 			pipeFactory.create(producer.getOutputPort(), reader.getInputPort());
 			pipeFactory.create(reader.getOutputPort(), typeFilter.getInputPort());
-			pipeFactory.create(typeFilter.getOutputPort(), reconstructor.getInputPort());
+			pipeFactory.create(typeFilter.getMatchedOutputPort(), reconstructor.getInputPort());
 			pipeFactory.create(reconstructor.getOutputPort(), collector.getInputPort());
 
 			this.addThreadableStage(producer);
diff --git a/src/test/java/kieker/diagnosis/model/importer/stages/TraceStatisticsDecoratorTest.java b/src/test/java/kieker/diagnosis/model/importer/stages/TraceStatisticsDecoratorTest.java
index 91223246..91e120af 100644
--- a/src/test/java/kieker/diagnosis/model/importer/stages/TraceStatisticsDecoratorTest.java
+++ b/src/test/java/kieker/diagnosis/model/importer/stages/TraceStatisticsDecoratorTest.java
@@ -21,7 +21,6 @@ import static org.hamcrest.number.IsCloseTo.closeTo;
 import static org.junit.Assert.assertThat;
 import kieker.diagnosis.domain.OperationCall;
 import kieker.diagnosis.domain.Trace;
-import kieker.diagnosis.model.importer.stages.TraceStatisticsDecorator;
 
 import org.junit.Test;
 
@@ -29,11 +28,11 @@ public final class TraceStatisticsDecoratorTest {
 
 	@Test
 	public void percentCalculationShouldWork() throws Exception {
-		final OperationCall rootCall = new OperationCall("", "", "", 42);
-		final OperationCall child1 = new OperationCall("", "", "", 42);
-		final OperationCall child2 = new OperationCall("", "", "", 42);
-		final OperationCall child3 = new OperationCall("", "", "", 42);
-		final OperationCall child4 = new OperationCall("", "", "", 42);
+		final OperationCall rootCall = new OperationCall("", "", "", 42, 0);
+		final OperationCall child1 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child2 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child3 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child4 = new OperationCall("", "", "", 42, 0);
 
 		rootCall.setDuration(100);
 		child1.setDuration(70);
@@ -63,12 +62,12 @@ public final class TraceStatisticsDecoratorTest {
 
 	@Test
 	public void traceDepthCalculationInCommonCaseShouldWork() throws Exception {
-		final OperationCall rootCall = new OperationCall("", "", "", 1);
+		final OperationCall rootCall = new OperationCall("", "", "", 1, 0);
 
-		rootCall.addChild(new OperationCall("", "", "", 1));
-		rootCall.addChild(new OperationCall("", "", "", 1));
+		rootCall.addChild(new OperationCall("", "", "", 1, 0));
+		rootCall.addChild(new OperationCall("", "", "", 1, 0));
 
-		rootCall.getChildren().get(0).addChild(new OperationCall("", "", "", 1));
+		rootCall.getChildren().get(0).addChild(new OperationCall("", "", "", 1, 0));
 
 		final Trace trace = new Trace(rootCall, 1);
 
@@ -82,7 +81,7 @@ public final class TraceStatisticsDecoratorTest {
 
 	@Test
 	public void traceDepthCalculationForNoChildrenShouldWork() throws Exception {
-		final OperationCall rootCall = new OperationCall("", "", "", 1);
+		final OperationCall rootCall = new OperationCall("", "", "", 1, 0);
 
 		final Trace trace = new Trace(rootCall, 1);
 
@@ -96,12 +95,12 @@ public final class TraceStatisticsDecoratorTest {
 
 	@Test
 	public void traceSizeCalculationInCommonCaseShouldWork() throws Exception {
-		final OperationCall rootCall = new OperationCall("", "", "", 42);
+		final OperationCall rootCall = new OperationCall("", "", "", 42, 0);
 
-		final OperationCall child1 = new OperationCall("", "", "", 42);
-		final OperationCall child2 = new OperationCall("", "", "", 42);
-		final OperationCall child3 = new OperationCall("", "", "", 42);
-		final OperationCall child4 = new OperationCall("", "", "", 42);
+		final OperationCall child1 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child2 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child3 = new OperationCall("", "", "", 42, 0);
+		final OperationCall child4 = new OperationCall("", "", "", 42, 0);
 
 		rootCall.addChild(child1);
 		rootCall.addChild(child2);
@@ -121,7 +120,7 @@ public final class TraceStatisticsDecoratorTest {
 
 	@Test
 	public void traceSizeCalculationForNoChildrenShouldWork() throws Exception {
-		final OperationCall rootCall = new OperationCall("", "", "", 1);
+		final OperationCall rootCall = new OperationCall("", "", "", 1, 0);
 
 		final Trace trace = new Trace(rootCall, 1);
 
-- 
GitLab