/** * Registers a given execution for the decorated vertex. * * @param execution * The execution to register */ public void registerExecution(final Execution execution) { final long responseTime = this.displayTimeunit.convert(execution.getTout() - execution.getTin(), this.executionTimeunit); this.responseTimeSum = this.responseTimeSum + responseTime; this.executionCount++; if (responseTime < this.minimalResponseTime) { this.minimalResponseTime = responseTime; } if (responseTime > this.maximalResponseTime) { this.maximalResponseTime = responseTime; } }
@Override public void processMessage(final AbstractMessage message, final DependencyGraphNode<?> sourceNode, final DependencyGraphNode<?> targetNode, final TimeUnit timeunit) { // Ignore internal executions if (sourceNode.equals(targetNode)) { return; } final long responseTime = message.getReceivingExecution().getTout() - message.getReceivingExecution().getTin(); final int convertedResponseTime = (int) DISPLAY_TIMEUNIT.convert(responseTime, timeunit); if (convertedResponseTime > this.threshold) { targetNode.setColor(COLOR); } }
prevE = poppedCall.getReceivingExecution(); curReturnReceiver = poppedCall.getSendingExecution(); final AbstractMessage m = new SynchronousReplyMessage(prevE.getTout(), prevE, curReturnReceiver); mSeq.add(m); prevE = poppedCall.getReceivingExecution(); curReturnReceiver = poppedCall.getSendingExecution(); final AbstractMessage m = new SynchronousReplyMessage(prevE.getTout(), prevE, curReturnReceiver); mSeq.add(m);
/** * This method can be used to debug the {@link java.util.Comparator} provided by {@link ExecutionTrace#createExecutionTraceComparator()}. */ @Test public void testTreeSet() { final SortedSet<Execution> s0 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final SortedSet<Execution> s1 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final Execution execFromTrace0 = this.exec0_0__bookstore_searchBook; final Execution long1 = new Execution(execFromTrace0.getOperation(), execFromTrace0.getAllocationComponent(), execFromTrace0.getTraceId(), execFromTrace0.getSessionId(), execFromTrace0.getEoi(), execFromTrace0.getEss(), execFromTrace0.getTin(), execFromTrace0.getTout(), execFromTrace0.isAssumed()); s0.add(execFromTrace0); s1.add(long1); Assert.assertEquals("Expected sets to be equal", s0, s1); }
@Before public void setUp() throws Exception { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); this.eFactory = new ExecutionFactory(systemEntityFactory); int myNumExecutions = 0; // Manually create Executions for a trace myNumExecutions++; this.exec0_0__bookstore_searchBook = this.eFactory.genExecution("Bookstore", "bookstore", "searchBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 1, 10, 0, 0); this.minTin = this.exec0_0__bookstore_searchBook.getTin(); this.maxTout = this.exec0_0__bookstore_searchBook.getTout(); myNumExecutions++; this.exec1_1__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 2, 4, 1, 1); myNumExecutions++; this.exec2_1__crm_getOrders = this.eFactory.genExecution("CRM", "crm", "getOrders", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 5, 8, 2, 1); myNumExecutions++; this.exec3_2__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 6, 7, 3, 2); // Just some basic checks to make sure that the trace has been set up properly (we've had some trouble here) Assert.assertNotSame(this.exec3_2__catalog_getBook.getOperation(), this.exec2_1__crm_getOrders.getOperation()); Assert.assertNotSame(this.exec0_0__bookstore_searchBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getAllocationComponent()); this.numExecutions = myNumExecutions; }
Assert.assertEquals(return1_1___catalog_getBook__bookstore_searchBook.getReceivingExecution(), this.exec0_0__bookstore_searchBook); Assert.assertEquals("Message has wrong timestamp", return1_1___catalog_getBook__bookstore_searchBook.getTimestamp(), this.exec1_1__catalog_getBook.getTout()); Assert.assertEquals(return3_2___catalog_getBook__crm_getOrders.getSendingExecution(), this.exec3_2__catalog_getBook); Assert.assertEquals(return3_2___catalog_getBook__crm_getOrders.getReceivingExecution(), this.exec2_1__crm_getOrders); Assert.assertEquals("Message has wrong timestamp", return3_2___catalog_getBook__crm_getOrders.getTimestamp(), this.exec3_2__catalog_getBook.getTout()); Assert.assertEquals(return2_1___crm_getOrders__bookstore_searchBook.getReceivingExecution(), this.exec0_0__bookstore_searchBook); Assert.assertEquals("Message has wrong timestamp", return2_1___crm_getOrders__bookstore_searchBook.getTimestamp(), this.exec2_1__crm_getOrders.getTout());
Assert.assertEquals("tout's differ", opExec.getTout(), exec.getTout()); Assert.assertEquals("eoi's differ", opExec.getEoi(), exec.getEoi()); Assert.assertEquals("ess's differ", opExec.getEss(), exec.getEss());
this.exec1_1__catalog_getBook.getTraceId() + 100, this.exec1_1__catalog_getBook.getSessionId() + "_", this.exec1_1__catalog_getBook.getEoi() + 100, this.exec1_1__catalog_getBook.getEss() + 100, this.exec1_1__catalog_getBook.getTin() + 100, this.exec1_1__catalog_getBook.getTout(), !this.exec1_1__catalog_getBook.isAssumed());