invocationSequenceData.setChildCount(invocationSequenceData.getChildCount() + 1L);
/** * Checks that the sequenceData have all the mandatory attributes. * * @param AggregatedDiagnosisInvocationData * Sequence data to check if has all the mandatory data. */ private void isAValidAggregatedDiagnosisData(AggregatedDiagnosisData AggregatedDiagnosisInvocationData) { for (InvocationSequenceData aggregatedSequence : AggregatedDiagnosisInvocationData.getRawInvocationsSequenceElements()) { assertThat("The aggregated sequence cannot be null", aggregatedSequence, notNullValue()); assertThat("Duration of the aggregated sequence cannot be null", aggregatedSequence.getDuration(), notNullValue()); assertThat("Start time of the aggregated cannot be null", aggregatedSequence.getStart(), notNullValue()); assertThat("End time of the aggregated cannot be null", aggregatedSequence.getEnd(), notNullValue()); assertThat("Child count of the aggregated sequence cannot be null", aggregatedSequence.getChildCount(), notNullValue()); assertThat("ApplicationId of the aggregated sequence cannot be null", aggregatedSequence.getApplicationId(), notNullValue()); assertThat("Business transaction id of the aggregated sequence cannot be null", aggregatedSequence.getBusinessTransactionId(), notNullValue()); } }
parentSequence.setChildCount(parentSequence.getChildCount() - 1); parentSequence.getNestedSequences().add(child); parentSequence.setChildCount(parentSequence.getChildCount() + invocationSequenceData.getChildCount()); parentSequence.setChildCount(parentSequence.getChildCount() + invocationSequenceData.getChildCount());
assertThat(invocation.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), is(empty())); assertThat(invocation.getChildCount(), is(0L)); assertThat(invocation.getSpanIdent(), is(SpanContextTransformer.transformSpanContext(context)));
assertThat(invocation.getDuration(), is(thirdTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(0)); assertThat(invocation.getChildCount(), is(0L));
assertThat(invocation.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), is(empty())); assertThat(invocation.getChildCount(), is(0L)); assertThat(invocation.getSpanIdent(), is(SpanContextTransformer.transformSpanContext(context)));
assertThat(invocation.getDuration(), is(thirdTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(0)); assertThat(invocation.getChildCount(), is(0L));
assertThat(invocation.getDuration(), is(fifthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L));
assertThat(invocation.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), is(empty())); assertThat(invocation.getChildCount(), is(0L)); assertThat(invocation.getSpanIdent(), is(spanIdent));
assertThat(invocation.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), is(empty())); assertThat(invocation.getChildCount(), is(0L)); assertThat(invocation.getTimerData(), is(timerData)); assertThat(invocation.getSqlStatementData(), is(sqlStatementData));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getLoggingData(), is(loggingData));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getTimerData(), is(timerData));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getSqlStatementData(), is(sqlStatementData));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L));
assertThat(invocation.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getPlatformIdent(), is(platformId)); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getExceptionSensorDataObjects(), is(Collections.singletonList(exceptionData)));
assertThat(invocation.getDuration(), is(thirdTimerValue - firstTimerValue)); assertThat(invocation.getNestedSequences(), hasSize(1)); assertThat(invocation.getChildCount(), is(1L)); assertThat(invocation.getSpanIdent(), is(nullValue())); InvocationSequenceData child = invocation.getNestedSequences().iterator().next(); assertThat(child.getNestedSequences(), is(empty())); assertThat(child.getParentSequence(), is(invocation)); assertThat(child.getChildCount(), is(0L)); assertThat(child.getSpanIdent(), is(not(nullValue())));
/** * {@inheritDoc} */ @Override public DetailsTable generate(DefaultData defaultData, RepositoryDefinition repositoryDefinition, Composite parent, FormToolkit toolkit) { InvocationSequenceData invocationSequenceData = (InvocationSequenceData) defaultData; DetailsTable table = new DetailsTable(parent, toolkit, "Invocation Sequence Info", 1); ApplicationData application = repositoryDefinition.getCachedDataService().getApplicationForId(invocationSequenceData.getApplicationId()); if (null != application) { table.addContentRow("Application:", null, new DetailsCellContent[] { new DetailsCellContent(application.getName()) }); } BusinessTransactionData businessTxData = repositoryDefinition.getCachedDataService().getBusinessTransactionForId(invocationSequenceData.getApplicationId(), invocationSequenceData.getBusinessTransactionId()); if (null != businessTxData) { table.addContentRow("Business Transactions:", null, new DetailsCellContent[] { new DetailsCellContent(businessTxData.getName()) }); } table.addContentRow("Children Count:", null, new DetailsCellContent[] { new DetailsCellContent(String.valueOf(invocationSequenceData.getChildCount())) }); table.addContentRow("Nested SQLs:", null, new DetailsCellContent[] { new YesNoDetailsCellContent(InvocationSequenceDataHelper.hasNestedSqlStatements(invocationSequenceData)) }); table.addContentRow("Nested Exceptions:", null, new DetailsCellContent[] { new YesNoDetailsCellContent(InvocationSequenceDataHelper.hasNestedExceptions(invocationSequenceData)) }); return table; }
switch (this) { case CHILD_COUNT: return Long.compare(o1.getChildCount(), o2.getChildCount()); case DURATION: if (InvocationSequenceDataHelper.hasTimerData(o1) && InvocationSequenceDataHelper.hasTimerData(o2)) {
/** * Clones invocation sequence. This method returns new object exactly same as the original * object, but with out nested sequences set. * * @return Cloned invocation sequence. */ public InvocationSequenceData getClonedInvocationSequence() { InvocationSequenceData clone = new InvocationSequenceData(this.getTimeStamp(), this.getPlatformIdent(), this.getSensorTypeIdent(), this.getMethodIdent()); clone.setId(this.getId()); clone.setSpanIdent(this.getSpanIdent()); clone.setChildCount(this.getChildCount()); clone.setDuration(this.getDuration()); clone.setEnd(this.getEnd()); clone.setNestedSequences(Collections.<InvocationSequenceData> emptyList()); clone.setParameterContentData(this.getParameterContentData()); clone.setParentSequence(this.getParentSequence()); clone.setPosition(this.getPosition()); clone.setSqlStatementData(this.getSqlStatementData()); clone.setTimerData(this.getTimerData()); clone.setExceptionSensorDataObjects(this.getExceptionSensorDataObjects()); clone.setStart(this.getStart()); clone.setNestedSqlStatements(this.isNestedSqlStatements()); clone.setNestedExceptions(this.isNestedExceptions()); clone.setLoggingData(this.getLoggingData()); clone.setApplicationId(this.getApplicationId()); clone.setBusinessTransactionId(this.getBusinessTransactionId()); return clone; }