/** * Saves beside the <code>Global Context</code> all reachable {@link InvocationSequenceData} * from the <code>Global Context</code> in {@link resultList} when ExclusiveTimeData is * available. * * @param invocationSequences * List that only holds the <code>Global Context</code>. * @param resultList * List with <code>Global Context</code> and invocation sequences reachable from the * <code>Global Context</code>. * @return List with {@link InvocationSequenceData}. */ private List<InvocationSequenceData> asInvocationSequenceDataList(List<InvocationSequenceData> invocationSequences, final List<InvocationSequenceData> resultList) { for (InvocationSequenceData invocationSequence : invocationSequences) { TimerData timerData = InvocationSequenceDataHelper.getTimerDataOrSQLData(invocationSequence); if ((timerData != null) && timerData.isExclusiveTimeDataAvailable()) { resultList.add(invocationSequence); } asInvocationSequenceDataList(invocationSequence.getNestedSequences(), resultList); } return resultList; }
/** * Gets the exclusive duration of the invocation sequence data element, in case the element has * not timer data or has not the exclusive time available it will returns 0. * * @param data * the <code>InvocationSequenceData</code> object. * @return the exclusive duration of this invocation sequence data element or 0. */ public static double getExclusiveDuration(InvocationSequenceData data) { TimerData timerData; if (InvocationSequenceDataHelper.hasSQLData(data)) { timerData = data.getSqlStatementData(); } else if (InvocationSequenceDataHelper.hasTimerData(data)) { timerData = data.getTimerData(); } else { return 0.0; } if (timerData.isExclusiveTimeDataAvailable()) { return timerData.getExclusiveDuration(); } else { return 0.0; } }
return new StyledString(NumberFormatter.formatDouble(data.getDuration())); case EXCLUSIVEAVERAGE: if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveAverage())); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMax())); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMin())); } else {
/** * {@inheritDoc} */ @Override public DetailsTable generate(DefaultData defaultData, RepositoryDefinition repositoryDefinition, Composite parent, FormToolkit toolkit) { TimerData timerData = (TimerData) defaultData; DetailsTable table = new DetailsTable(parent, toolkit, "Duration Info", 1); // then the total duration DetailsCellContent[] total = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatDouble(timerData.getDuration())) }; table.addContentRow("Total (ms):", null, total); if (timerData.isCpuMetricDataAvailable()) { // then the total duration DetailsCellContent[] cpu = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatDouble(timerData.getCpuDuration())) }; table.addContentRow("CPU (ms):", null, cpu); } if (timerData.isExclusiveTimeDataAvailable()) { // then the exclusive DetailsCellContent[] exclusive = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatDouble(timerData.getExclusiveDuration())) }; table.addContentRow("Exclusive (ms):", null, exclusive); } return table; }
if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveAverage(), timeDecimalPlaces)); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMax(), timeDecimalPlaces)); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMin(), timeDecimalPlaces)); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveDuration(), timeDecimalPlaces)); } else {
if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveDuration())); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveAverage())); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMin())); } else { if (data.isExclusiveTimeDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getExclusiveMax())); } else {
/** * {@inheritDoc} * <p> * This method does not aggregate the {@link InvocationAwareData} because it is not needed in * the database. */ @Override public void aggregateTimerData(TimerData timerData) { this.setCount(this.getCount() + timerData.getCount()); this.setDuration(this.getDuration() + timerData.getDuration()); this.calculateMax(timerData.getMax()); this.calculateMin(timerData.getMin()); if (timerData.isCpuMetricDataAvailable()) { this.setCpuDuration(this.getCpuDuration() + timerData.getCpuDuration()); this.calculateCpuMin(timerData.getCpuMin()); this.calculateCpuMax(timerData.getCpuMax()); } if (timerData.isExclusiveTimeDataAvailable()) { this.addExclusiveDuration(timerData.getExclusiveDuration()); this.setExclusiveCount(this.getExclusiveCount() + timerData.getExclusiveCount()); this.calculateExclusiveMin(timerData.getExclusiveMin()); this.calculateExclusiveMax(timerData.getExclusiveMax()); } } }
/** * Aggregates the values given in the supplied timer data parameter to the objects data. * * @param timerData * Data to be aggregated into current object. */ public void aggregateTimerData(TimerData timerData) { super.aggregateInvocationAwareData(timerData); this.setCount(this.getCount() + timerData.getCount()); this.setDuration(this.getDuration() + timerData.getDuration()); this.calculateMax(timerData.getMax()); this.calculateMin(timerData.getMin()); if (timerData.isCpuMetricDataAvailable()) { this.setCpuDuration(this.getCpuDuration() + timerData.getCpuDuration()); this.calculateCpuMax(timerData.getCpuMax()); this.calculateCpuMin(timerData.getCpuMin()); } if (timerData.isExclusiveTimeDataAvailable()) { this.addExclusiveDuration(timerData.getExclusiveDuration()); this.setExclusiveCount(this.getExclusiveCount() + timerData.getExclusiveCount()); this.calculateExclusiveMax(timerData.getExclusiveMax()); this.calculateExclusiveMin(timerData.getExclusiveMin()); } this.charting = this.charting | timerData.isCharting(); }
if (timerData.isExclusiveTimeDataAvailable()) {