diff --git a/src/main/java/kieker/gui/view/AggregatedTracesSubView.java b/src/main/java/kieker/gui/view/AggregatedTracesSubView.java index 0ffb1b150320d3f3260ef5173d0ec06523071962..08f0c25e0d6ce118a0ee101f7bdfd92f00ef4676 100644 --- a/src/main/java/kieker/gui/view/AggregatedTracesSubView.java +++ b/src/main/java/kieker/gui/view/AggregatedTracesSubView.java @@ -25,6 +25,14 @@ import kieker.gui.model.AggregatedTracesSubViewModel; import kieker.gui.model.DataModel; import kieker.gui.model.PropertiesModel; import kieker.gui.model.domain.AggregatedExecution; +import kieker.gui.view.util.AggregatedExecutionAvgDurationComparator; +import kieker.gui.view.util.AggregatedExecutionCallComparator; +import kieker.gui.view.util.AggregatedExecutionMaxDurationComparator; +import kieker.gui.view.util.AggregatedExecutionMinDurationComparator; +import kieker.gui.view.util.ExecutionComponentComparator; +import kieker.gui.view.util.ExecutionContainerComparator; +import kieker.gui.view.util.ExecutionOperationComparator; +import kieker.gui.view.util.TreeColumnSortListener; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -206,6 +214,14 @@ public class AggregatedTracesSubView implements Observer, ISubView { this.tree.addSelectionListener(this.controller); this.tree.addListener(SWT.SetData, new DataProvider()); + + trclmnExecutionContainer.addSelectionListener(new TreeColumnSortListener<>(new ExecutionContainerComparator())); + trclmnComponent.addSelectionListener(new TreeColumnSortListener<>(new ExecutionComponentComparator())); + trclmnOperation.addSelectionListener(new TreeColumnSortListener<>(new ExecutionOperationComparator())); + trclmnMinimalDuration.addSelectionListener(new TreeColumnSortListener<>(new AggregatedExecutionMinDurationComparator())); + trclmnMaximalDuration.addSelectionListener(new TreeColumnSortListener<>(new AggregatedExecutionMaxDurationComparator())); + trclmnAverageDuration.addSelectionListener(new TreeColumnSortListener<>(new AggregatedExecutionAvgDurationComparator())); + trclmnCalls.addSelectionListener(new TreeColumnSortListener<>(new AggregatedExecutionCallComparator())); } @Override @@ -314,7 +330,7 @@ public class AggregatedTracesSubView implements Observer, ISubView { item.setText(new String[] { executionEntry.getContainer(), componentName, operationString, "", minDuration, avgDuration, maxDuration }); } else { item.setText(new String[] { executionEntry.getContainer(), componentName, operationString, Integer.toString(executionEntry.getCalls()), minDuration, avgDuration, - maxDuration }); + maxDuration }); } if (executionEntry.isFailed()) { diff --git a/src/main/java/kieker/gui/view/RecordsSubView.java b/src/main/java/kieker/gui/view/RecordsSubView.java index b216ab6f539f5dabfaf6e0e9ad28717a1e010c6b..b9904e5a9daadee9ca6dedee9881b30af64d4286 100644 --- a/src/main/java/kieker/gui/view/RecordsSubView.java +++ b/src/main/java/kieker/gui/view/RecordsSubView.java @@ -23,8 +23,8 @@ import java.util.Observer; import kieker.gui.controller.RecordsSubViewController; import kieker.gui.model.DataModel; import kieker.gui.model.domain.Record; -import kieker.gui.view.util.RecordEntryTimestampComparator; -import kieker.gui.view.util.RecordEntryTypeComparator; +import kieker.gui.view.util.RecordTimestampComparator; +import kieker.gui.view.util.RecordTypeComparator; import kieker.gui.view.util.TableColumnSortListener; import org.eclipse.jface.viewers.TableViewer; @@ -80,9 +80,9 @@ public final class RecordsSubView implements Observer, ISubView { this.table.addListener(SWT.SetData, new DataProvider()); - tblclmnTimestamp.addSelectionListener(new TableColumnSortListener<>(new RecordEntryTimestampComparator())); - tblclmnRecordType.addSelectionListener(new TableColumnSortListener<>(new RecordEntryTypeComparator())); - tblclmnRecordContent.addSelectionListener(new TableColumnSortListener<>(new RecordEntryTimestampComparator())); + tblclmnTimestamp.addSelectionListener(new TableColumnSortListener<>(new RecordTimestampComparator())); + tblclmnRecordType.addSelectionListener(new TableColumnSortListener<>(new RecordTypeComparator())); + tblclmnRecordContent.addSelectionListener(new TableColumnSortListener<>(new RecordTimestampComparator())); } public Table getTable() { diff --git a/src/main/java/kieker/gui/view/TracesSubView.java b/src/main/java/kieker/gui/view/TracesSubView.java index 565d79a4f3d90a3fbc5f8bbb410e8a98cfed68d1..6183c75dcd9827c0dd09870e4336398e5b2ee029 100644 --- a/src/main/java/kieker/gui/view/TracesSubView.java +++ b/src/main/java/kieker/gui/view/TracesSubView.java @@ -24,11 +24,11 @@ import kieker.gui.model.DataModel; import kieker.gui.model.PropertiesModel; import kieker.gui.model.TracesSubViewModel; import kieker.gui.model.domain.Execution; -import kieker.gui.view.util.ExecutionEntryComponentComparator; -import kieker.gui.view.util.ExecutionEntryContainerComparator; -import kieker.gui.view.util.ExecutionEntryDurationComparator; -import kieker.gui.view.util.ExecutionEntryOperationComparator; -import kieker.gui.view.util.ExecutionEntryTraceIDComparator; +import kieker.gui.view.util.ExecutionComponentComparator; +import kieker.gui.view.util.ExecutionContainerComparator; +import kieker.gui.view.util.ExecutionDurationComparator; +import kieker.gui.view.util.ExecutionOperationComparator; +import kieker.gui.view.util.ExecutionTraceIDComparator; import kieker.gui.view.util.TreeColumnSortListener; import org.eclipse.swt.SWT; @@ -196,11 +196,11 @@ public class TracesSubView implements Observer, ISubView { this.tree.addSelectionListener(this.controller); this.tree.addListener(SWT.SetData, new DataProvider()); - trclmnExecutionContainer.addSelectionListener(new TreeColumnSortListener<>(new ExecutionEntryContainerComparator())); - trclmnComponent.addSelectionListener(new TreeColumnSortListener<>(new ExecutionEntryComponentComparator())); - trclmnOperation.addSelectionListener(new TreeColumnSortListener<>(new ExecutionEntryOperationComparator())); - trclmnDuration.addSelectionListener(new TreeColumnSortListener<>(new ExecutionEntryDurationComparator())); - trclmnTraceId.addSelectionListener(new TreeColumnSortListener<>(new ExecutionEntryTraceIDComparator())); + trclmnExecutionContainer.addSelectionListener(new TreeColumnSortListener<>(new ExecutionContainerComparator())); + trclmnComponent.addSelectionListener(new TreeColumnSortListener<>(new ExecutionComponentComparator())); + trclmnOperation.addSelectionListener(new TreeColumnSortListener<>(new ExecutionOperationComparator())); + trclmnDuration.addSelectionListener(new TreeColumnSortListener<>(new ExecutionDurationComparator())); + trclmnTraceId.addSelectionListener(new TreeColumnSortListener<>(new ExecutionTraceIDComparator())); } public Tree getTree() { diff --git a/src/main/java/kieker/gui/view/util/AggregatedExecutionAvgDurationComparator.java b/src/main/java/kieker/gui/view/util/AggregatedExecutionAvgDurationComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..4ad8a57ce7c24e9835d6ec4fed45f5cd744dba8f --- /dev/null +++ b/src/main/java/kieker/gui/view/util/AggregatedExecutionAvgDurationComparator.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.gui.view.util; + +import kieker.gui.model.domain.AggregatedExecution; + +import org.eclipse.swt.SWT; + +public class AggregatedExecutionAvgDurationComparator extends AbstractDirectedComparator<AggregatedExecution> { + + @Override + public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) { + int result = Long.compare(arg0.getAvgDuration(), arg1.getAvgDuration()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/AggregatedExecutionCallComparator.java b/src/main/java/kieker/gui/view/util/AggregatedExecutionCallComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..74a4a0bcc5ac91691efb3682407095ca8a6d15f5 --- /dev/null +++ b/src/main/java/kieker/gui/view/util/AggregatedExecutionCallComparator.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.gui.view.util; + +import kieker.gui.model.domain.AggregatedExecution; + +import org.eclipse.swt.SWT; + +public class AggregatedExecutionCallComparator extends AbstractDirectedComparator<AggregatedExecution> { + + @Override + public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) { + int result = Long.compare(arg0.getCalls(), arg1.getCalls()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/AggregatedExecutionMaxDurationComparator.java b/src/main/java/kieker/gui/view/util/AggregatedExecutionMaxDurationComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..8b3a48257e8748026a2f4392ad70e3f0c8e818fa --- /dev/null +++ b/src/main/java/kieker/gui/view/util/AggregatedExecutionMaxDurationComparator.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.gui.view.util; + +import kieker.gui.model.domain.AggregatedExecution; + +import org.eclipse.swt.SWT; + +public class AggregatedExecutionMaxDurationComparator extends AbstractDirectedComparator<AggregatedExecution> { + + @Override + public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) { + int result = Long.compare(arg0.getMaxDuration(), arg1.getMaxDuration()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/AggregatedExecutionMinDurationComparator.java b/src/main/java/kieker/gui/view/util/AggregatedExecutionMinDurationComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..3f2bf7a4a3f76a193ea448330d7330a8b32b9e1c --- /dev/null +++ b/src/main/java/kieker/gui/view/util/AggregatedExecutionMinDurationComparator.java @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright 2014 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.gui.view.util; + +import kieker.gui.model.domain.AggregatedExecution; + +import org.eclipse.swt.SWT; + +public class AggregatedExecutionMinDurationComparator extends AbstractDirectedComparator<AggregatedExecution> { + + @Override + public int compare(final AggregatedExecution arg0, final AggregatedExecution arg1) { + int result = Long.compare(arg0.getMinDuration(), arg1.getMinDuration()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java b/src/main/java/kieker/gui/view/util/ExecutionComponentComparator.java similarity index 75% rename from src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java rename to src/main/java/kieker/gui/view/util/ExecutionComponentComparator.java index 26916ebdbe4c0141078600a5236ae9f8f450605c..b308ed1aade842a3c4f9bfd07538e236ab9bfeb3 100644 --- a/src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java +++ b/src/main/java/kieker/gui/view/util/ExecutionComponentComparator.java @@ -16,20 +16,19 @@ package kieker.gui.view.util; -import kieker.gui.model.domain.Execution; +import kieker.gui.model.domain.AbstractExecution; import org.eclipse.swt.SWT; -public class ExecutionEntryComponentComparator extends AbstractDirectedComparator<Execution> { +public class ExecutionComponentComparator extends AbstractDirectedComparator<AbstractExecution<?>> { @Override - public int compare(final Execution arg0, final Execution arg1) { - int result = arg0.getComponent().compareTo(arg1.getOperation()); + public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) { + int result = fst.getComponent().compareTo(snd.getComponent()); if (this.getDirection() == SWT.UP) { result = -result; } return result; - } } diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryContainerComparator.java b/src/main/java/kieker/gui/view/util/ExecutionContainerComparator.java similarity index 75% rename from src/main/java/kieker/gui/view/util/ExecutionEntryContainerComparator.java rename to src/main/java/kieker/gui/view/util/ExecutionContainerComparator.java index 12b175e59f9b3092b69ded301f472e4ef535827d..c1b0516af15e5ddef68cb593d92b5bd4a957c8c9 100644 --- a/src/main/java/kieker/gui/view/util/ExecutionEntryContainerComparator.java +++ b/src/main/java/kieker/gui/view/util/ExecutionContainerComparator.java @@ -16,20 +16,19 @@ package kieker.gui.view.util; -import kieker.gui.model.domain.Execution; +import kieker.gui.model.domain.AbstractExecution; import org.eclipse.swt.SWT; -public class ExecutionEntryContainerComparator extends AbstractDirectedComparator<Execution> { +public class ExecutionContainerComparator extends AbstractDirectedComparator<AbstractExecution<?>> { @Override - public int compare(final Execution arg0, final Execution arg1) { - int result = arg0.getContainer().compareTo(arg1.getContainer()); + public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) { + int result = fst.getContainer().compareTo(snd.getContainer()); if (this.getDirection() == SWT.UP) { result = -result; } return result; - } } diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java b/src/main/java/kieker/gui/view/util/ExecutionDurationComparator.java similarity index 92% rename from src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java rename to src/main/java/kieker/gui/view/util/ExecutionDurationComparator.java index 34c739f7ae9e1f4296535cb1c147afcc059c1b93..2e5662095f3a3cb40587f219e82acf34d32879a0 100644 --- a/src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java +++ b/src/main/java/kieker/gui/view/util/ExecutionDurationComparator.java @@ -20,7 +20,7 @@ import kieker.gui.model.domain.Execution; import org.eclipse.swt.SWT; -public class ExecutionEntryDurationComparator extends AbstractDirectedComparator<Execution> { +public class ExecutionDurationComparator extends AbstractDirectedComparator<Execution> { @Override public int compare(final Execution arg0, final Execution arg1) { diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java b/src/main/java/kieker/gui/view/util/ExecutionOperationComparator.java similarity index 75% rename from src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java rename to src/main/java/kieker/gui/view/util/ExecutionOperationComparator.java index 4099070783dbd9ec270fbe2dd81757db3d506844..1a0f2e666382c1f289220296a0de72531e7115a6 100644 --- a/src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java +++ b/src/main/java/kieker/gui/view/util/ExecutionOperationComparator.java @@ -16,20 +16,19 @@ package kieker.gui.view.util; -import kieker.gui.model.domain.Execution; +import kieker.gui.model.domain.AbstractExecution; import org.eclipse.swt.SWT; -public class ExecutionEntryOperationComparator extends AbstractDirectedComparator<Execution> { +public class ExecutionOperationComparator extends AbstractDirectedComparator<AbstractExecution<?>> { @Override - public int compare(final Execution arg0, final Execution arg1) { - int result = arg0.getOperation().compareTo(arg1.getOperation()); + public int compare(final AbstractExecution<?> fst, final AbstractExecution<?> snd) { + int result = fst.getOperation().compareTo(snd.getOperation()); if (this.getDirection() == SWT.UP) { result = -result; } return result; - } } diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryTraceIDComparator.java b/src/main/java/kieker/gui/view/util/ExecutionTraceIDComparator.java similarity index 92% rename from src/main/java/kieker/gui/view/util/ExecutionEntryTraceIDComparator.java rename to src/main/java/kieker/gui/view/util/ExecutionTraceIDComparator.java index 24ec256ebf0d22d19b6f03554afe87d6b03f7f37..ea31cb3997cadaa882f6c3b1baf3d7e31c0a64e5 100644 --- a/src/main/java/kieker/gui/view/util/ExecutionEntryTraceIDComparator.java +++ b/src/main/java/kieker/gui/view/util/ExecutionTraceIDComparator.java @@ -20,7 +20,7 @@ import kieker.gui.model.domain.Execution; import org.eclipse.swt.SWT; -public class ExecutionEntryTraceIDComparator extends AbstractDirectedComparator<Execution> { +public class ExecutionTraceIDComparator extends AbstractDirectedComparator<Execution> { @Override public int compare(final Execution arg0, final Execution arg1) { diff --git a/src/main/java/kieker/gui/view/util/RecordEntryTimestampComparator.java b/src/main/java/kieker/gui/view/util/RecordTimestampComparator.java similarity index 92% rename from src/main/java/kieker/gui/view/util/RecordEntryTimestampComparator.java rename to src/main/java/kieker/gui/view/util/RecordTimestampComparator.java index 8abeb9ef153fe105877516248ddf40eee2439585..36e10c0d8ae9bf6944854c2755078511312600b8 100644 --- a/src/main/java/kieker/gui/view/util/RecordEntryTimestampComparator.java +++ b/src/main/java/kieker/gui/view/util/RecordTimestampComparator.java @@ -20,7 +20,7 @@ import kieker.gui.model.domain.Record; import org.eclipse.swt.SWT; -public class RecordEntryTimestampComparator extends AbstractDirectedComparator<Record> { +public class RecordTimestampComparator extends AbstractDirectedComparator<Record> { @Override public int compare(final Record o1, final Record o2) { diff --git a/src/main/java/kieker/gui/view/util/RecordEntryTypeComparator.java b/src/main/java/kieker/gui/view/util/RecordTypeComparator.java similarity index 92% rename from src/main/java/kieker/gui/view/util/RecordEntryTypeComparator.java rename to src/main/java/kieker/gui/view/util/RecordTypeComparator.java index efa3cd1630f0e2052a2b928b3d0292cd449ce6fd..92055188c8d2ab0ce28f91e75ad7b6eec703be67 100644 --- a/src/main/java/kieker/gui/view/util/RecordEntryTypeComparator.java +++ b/src/main/java/kieker/gui/view/util/RecordTypeComparator.java @@ -20,7 +20,7 @@ import kieker.gui.model.domain.Record; import org.eclipse.swt.SWT; -public class RecordEntryTypeComparator extends AbstractDirectedComparator<Record> { +public class RecordTypeComparator extends AbstractDirectedComparator<Record> { @Override public int compare(final Record o1, final Record o2) {