@BeforeMethod public void init() { when(problemOccurrence.getApplicationNameIdent()).thenReturn(APP_ID); when(problemOccurrence.getBusinessTransactionNameIdent()).thenReturn(BUSINESS_TX_ID); when(problemOccurrence.getProblemContext()).thenReturn(invocationIdentifier); when(problemOccurrence.getRequestRoot()).thenReturn(invocationIdentifier); when(problemOccurrence.getGlobalContext()).thenReturn(invocationIdentifier); when(problemOccurrence.getCauseType()).thenReturn(causeType); when(problemOccurrence.getSourceType()).thenReturn(sourceType); when(problemOccurrence.getRootCause()).thenReturn(rootCause); when(invocationIdentifier.getDiagnosisTimerData()).thenReturn(diagnosisTimerData); when(rootCause.getAggregatedDiagnosisTimerData()).thenReturn(aggregatedDiagnosisTimerData); when(diagnosisTimerData.getDuration()).thenReturn(DURATION); when(diagnosisTimerData.getExclusiveDuration()).thenReturn(EXCLUSIVE_DURATION); when(aggregatedDiagnosisTimerData.getExclusiveDuration()).thenReturn(EXCLUSIVE_DURATION); when(applicationData.getName()).thenReturn(APPLICATION_NAME); when(businessTransactionData.getName()).thenReturn(BUSINESS_TX); when(methodIdent.getMethodName()).thenReturn(METHOD); when(methodIdent.getFQN()).thenReturn(FQN); }
RootCause rootCause = new RootCause(rootCauseInvocations.get().getMethodIdent(), rootCauseInvocations.get().getAggregatedDiagnosisTimerData()); ProblemOccurrence problem = new ProblemOccurrence(inputInvocationSequence, globalContext.get(), problemContext.get().getCommonContext(), rootCause, causeStructure.get().getCauseType(), causeStructure.get().getSourceType()); RootCause rootCause = new RootCause(globalContext.get().getMethodIdent(), new AggregatedDiagnosisTimerData(InvocationSequenceDataHelper.getTimerDataOrSQLData(globalContext.get()))); ProblemOccurrence problem = new ProblemOccurrence(inputInvocationSequence, globalContext.get(), rootCause);
return false; } else if (!this.rootCause.equals(other.rootCause)) { return false;
/** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + this.applicationNameIdent; result = (prime * result) + this.businessTransactionNameIdent; result = (prime * result) + ((this.causeType == null) ? 0 : this.causeType.hashCode()); result = (prime * result) + ((this.globalContext == null) ? 0 : this.globalContext.hashCode()); result = (prime * result) + ((this.problemContext == null) ? 0 : this.problemContext.hashCode()); result = (prime * result) + ((this.requestRoot == null) ? 0 : this.requestRoot.hashCode()); result = (prime * result) + ((this.rootCause == null) ? 0 : this.rootCause.hashCode()); result = (prime * result) + ((this.sourceType == null) ? 0 : this.sourceType.hashCode()); return result; }
MethodIdent rootCauseMethodIdent = cachedDataService.getMethodIdentForId(data.getRootCause().getMethodIdent()); if (rootCauseMethodIdent != null) { rootCauseName = rootCauseMethodIdent.getFQN() + "." + rootCauseMethodIdent.getMethodName();
/** * Add fields to builder. * * @param data * ProblemOccurrence instance * @param builder * Builder that can be used to create influx points. */ protected void addFields(ProblemOccurrence data, Builder builder) { builder.addField(Series.ProblemOccurrenceInformation.FIELD_INVOCATION_ROOT_DURATION, data.getRequestRoot().getDiagnosisTimerData().getDuration()); builder.addField(Series.ProblemOccurrenceInformation.FIELD_GLOBAL_CONTEXT_METHOD_EXCLUSIVE_TIME, data.getGlobalContext().getDiagnosisTimerData().getExclusiveDuration()); builder.addField(Series.ProblemOccurrenceInformation.FIELD_ROOTCAUSE_METHOD_EXCLUSIVE_TIME, data.getRootCause().getAggregatedDiagnosisTimerData().getExclusiveDuration()); builder.addField(Series.ProblemOccurrenceInformation.FIELD_ROOTCAUSE_METHOD_EXCLUSIVE_COUNT, data.getRootCause().getAggregatedDiagnosisTimerData().getExclusiveCount()); }