/** * 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()); } }
invocationSequenceData.setDuration(invocationSequenceData.getEnd() - invocationSequenceData.getStart()); parentSequence.setChildCount(parentSequence.getChildCount() + invocationSequenceData.getChildCount());
/** * 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; }