/** * Gets the {@link AggregatedDiagnosisData} with all the TimeWastingOperations. Just the * {@link InvocationSequenceData} with highest exclusive time are considered as * TimeWastingOperations. * * @param timeWastingOperationsCandidates * {@link AggregatedDiagnosisData} which are considered as candidates to be * TimeWastingOperations. * @return Returns the list of {@link AggregatedDiagnosisData} which are TimeWastingOperations. */ private List<AggregatedDiagnosisData> getTimeWastingOperations(List<AggregatedDiagnosisData> timeWastingOperationsCandidates) { List<AggregatedDiagnosisData> timeWastingOperations = new ArrayList<>(); double sumExecTime = 0; double globalContextDuration = globalContext.getDuration(); for (AggregatedDiagnosisData aggregatedDiagnosisData : timeWastingOperationsCandidates) { double aggregatedDataExclusiveDuration = aggregatedDiagnosisData.getAggregatedDiagnosisTimerData().getExclusiveDuration(); if ((sumExecTime < (PROPORTION * globalContextDuration)) || (aggregatedDataExclusiveDuration > baseline) || (aggregatedDiagnosisData.getAggregatedDiagnosisTimerData().getExclusiveCount() >= METHODEXECUTIONCOUNT)) { // increase sumExclusiveTime by duration of Time Wasting Operation. sumExecTime += aggregatedDataExclusiveDuration; timeWastingOperations.add(aggregatedDiagnosisData); } } return timeWastingOperations; }
/** * 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()); }