/** * Removes all data from the upper plot and sets the {@link TimerData} objects on the plot. * * @param map * The data to set on the plot. */ protected void setCountPlotData(Map<Object, List<E>> map) { for (TimeSeries series : countSeries) { series.clear(); series.setNotify(false); for (Entry<Object, List<E>> entry : map.entrySet()) { if (series.getKey().equals(entry.getKey())) { for (E data : entry.getValue()) { series.addOrUpdate(new Millisecond(data.getTimeStamp()), data.getCount()); } break; } } series.setNotify(true); series.fireSeriesChanged(); } }
@Override public boolean matches(Object argument) { if (!DatabaseAggregatedTimerData.class.equals(argument.getClass())) { return false; } TimerData timerData = (TimerData) argument; assertThat(timerData.getCount() % count, is(equalTo(0L))); assertThat(timerData.getMin(), is(equalTo(min))); assertThat(timerData.getMax(), is(equalTo(max))); assertThat(timerData.getAverage(), is(equalTo(average))); assertThat(timerData.getDuration() / timerData.getCount(), is(equalTo(average))); assertThat(timerData.getCpuMin(), is(equalTo(min))); assertThat(timerData.getCpuMax(), is(equalTo(max))); assertThat(timerData.getCpuAverage(), is(equalTo(average))); assertThat(timerData.getCpuDuration() / timerData.getCount(), is(equalTo(average))); assertThat(timerData.getExclusiveMin(), is(equalTo(min))); assertThat(timerData.getExclusiveMax(), is(equalTo(max))); assertThat(timerData.getExclusiveAverage(), is(equalTo(average))); return true; } }));
assertThat(timerData.getSensorTypeIdent(), is(sensorTypeId)); assertThat(timerData.getTimeStamp(), is(not(nullValue()))); assertThat(timerData.getCount(), is(1L)); assertThat(timerData.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(timerData.getMin(), is(secondTimerValue - firstTimerValue));
assertThat(timerData.getSensorTypeIdent(), is(sensorTypeId)); assertThat(timerData.getTimeStamp(), is(not(nullValue()))); assertThat(timerData.getCount(), is(1L)); assertThat(timerData.getDuration(), is(thirdTimerValue - secondTimerValue)); assertThat(timerData.getMin(), is(thirdTimerValue - secondTimerValue)); assertThat(timerData.getSensorTypeIdent(), is(sensorTypeId)); assertThat(timerData.getTimeStamp(), is(not(nullValue()))); assertThat(timerData.getCount(), is(1L)); assertThat(timerData.getDuration(), is(fourthTimerValue - firstTimerValue)); assertThat(timerData.getMin(), is(fourthTimerValue - firstTimerValue));
assertThat(timerData.getSensorTypeIdent(), is(sensorTypeId)); assertThat(timerData.getTimeStamp(), is(not(nullValue()))); assertThat(timerData.getCount(), is(1L)); assertThat(timerData.getDuration(), is(secondTimerValue - firstTimerValue)); assertThat(timerData.getMin(), is(secondTimerValue - firstTimerValue)); assertThat(timerData.getSensorTypeIdent(), is(sensorTypeId)); assertThat(timerData.getTimeStamp(), is(not(nullValue()))); assertThat(timerData.getCount(), is(1L)); assertThat(timerData.getDuration(), is(fourthTimerValue - thirdTimerValue)); assertThat(timerData.getMin(), is(fourthTimerValue - thirdTimerValue));
/** * {@inheritDoc} */ @Override protected void addFields(TimerData data, Builder builder) { // fields builder.addField(Series.Methods.FIELD_MIN_DURATION, data.getMin()); builder.addField(Series.Methods.FIELD_DURATION, data.getAverage()); builder.addField(Series.Methods.FIELD_MAX_DURATION, data.getMax()); builder.addField(Series.Methods.FIELD_MIN_CPU_TIME, data.getCpuMin()); builder.addField(Series.Methods.FIELD_CPU_TIME, data.getCpuAverage()); builder.addField(Series.Methods.FIELD_MAX_CPU_TIME, data.getCpuMax()); builder.addField(Series.Methods.FIELD_COUNT, data.getCount()); }
/** * 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(); }
DetailsCellContent[] total = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatLong(timerData.getCount())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getAverage())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getMin())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getMax())) }; DetailsCellContent[] cpu = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatLong(timerData.getCount())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getCpuAverage())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getCpuMin())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getCpuMax())) }; DetailsCellContent[] exclusive = new DetailsCellContent[] { new DetailsCellContent(NumberFormatter.formatLong(timerData.getCount())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getExclusiveAverage())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getExclusiveMin())), new DetailsCellContent(NumberFormatter.formatDouble(timerData.getExclusiveMax())) };
switch (enumId) { case COUNT: return new StyledString(Long.toString(data.getCount())); case AVERAGE: return new StyledString(NumberFormatter.formatDouble(data.getAverage()));
/** * {@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()); } } }
return new StyledString(String.valueOf(data.getCount())); case AVERAGE: if (data.isTimeDataAvailable()) {
return new StyledString(TextFormatter.getMethodWithParameters(methodIdent)); case COUNT: return new StyledString(String.valueOf(data.getCount())); case AVERAGE: