/** * Returns the duration of this (possibly incomplete) trace. * * This value is the difference between the maximum tout and the minimum tin value. Note that no specific * assumptions about the {@link java.util.concurrent.TimeUnit} are made. * * @return the duration of this trace. */ public long getDuration() { synchronized (this) { return this.getMaxTout() - this.minTin; } }
@Override public long getEndTimestamp() { return this.getMaxTout(); }
/** * Tests whether the "well-known" Bookstore trace gets correctly * represented as an Execution Trace. * * @throws InvalidTraceException * If the internally assembled execution trace is somehow invalid. */ @Test public void testValidExecutionTrace() throws InvalidTraceException { final ExecutionTrace executionTrace = this.genValidBookstoreTrace(); // Perform some validity checks on the execution trace object Assert.assertEquals("Invalid length of Execution Trace", executionTrace.getLength(), this.numExecutions); Assert.assertEquals("Invalid maximum stack depth", executionTrace.getMaxEss(), 2); Assert.assertEquals("Invalid minimum tin timestamp", executionTrace.getMinTin(), this.minTin); Assert.assertEquals("Invalid maximum tout timestamp", executionTrace.getMaxTout(), this.maxTout); }
final long triggerTraceId = TestTraceReconstructionFilter.TRACE_ID + 1; final Execution exec0_0__bookstore_searchBook__trigger = executionFactory.genExecution("Bookstore", "bookstore", "searchBook", triggerTraceId, // NOCS TestTraceReconstructionFilter.SESSION_ID, incompleteExecutionTrace.getMaxTout(), incompleteExecutionTrace.getMaxTout() + (triggerTraceLengthMillis * (1000 * 1000)), 0, 0); // NOCS configuration.setProperty(TraceReconstructionFilter.CONFIG_PROPERTY_NAME_IGNORE_INVALID_TRACES, "true"); configuration.setProperty(TraceReconstructionFilter.CONFIG_PROPERTY_NAME_MAX_TRACE_DURATION, Long .toString((triggerExecutionTrace.getMaxTout() - incompleteExecutionTrace.getMinTin()) - 1)); final TraceReconstructionFilter filter = new TraceReconstructionFilter(configuration, controller); + triggerExecutionTrace.getMaxTout() + "\n" + "incompleteExecutionTrace.getMinTin()" + incompleteExecutionTrace.getMinTin() + "\n" + "filter.getMaxTraceDurationNanos()" + filter.getMaxTraceDuration(), (triggerExecutionTrace.getMaxTout() - incompleteExecutionTrace .getMinTin()) > filter.getMaxTraceDuration());