/** * {@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.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuAverage(), timeDecimalPlaces)); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuMin(), timeDecimalPlaces)); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuMax(), timeDecimalPlaces)); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuDuration(), timeDecimalPlaces)); } else {
if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuAverage())); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuMin())); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuMax())); } else { if (data.isCpuMetricDataAvailable()) { return new StyledString(NumberFormatter.formatDouble(data.getCpuDuration())); } else {
case CPUDURATION: styledString = new StyledString(); if (InvocationSequenceDataHelper.hasTimerData(data) && data.getTimerData().isCpuMetricDataAvailable()) { styledString.append(NumberFormatter.formatDouble(data.getTimerData().getCpuDuration()));
/** * {@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(); }
table.addContentRow("Total:", null, total); if (timerData.isCpuMetricDataAvailable()) {