diff --git a/config/findbugs/excludeFilter.xml b/config/findbugs/excludeFilter.xml index 5eac8d5d68ef543ac5586b28e9339b3fb109ddda..4a1eab8b1de14996d1f5422a682aa1d9ca8fc842 100644 --- a/config/findbugs/excludeFilter.xml +++ b/config/findbugs/excludeFilter.xml @@ -10,4 +10,9 @@ <Bug pattern="SE_INNER_CLASS" /> </Match> + <Match> + <Class name="kieker.diagnosis.subview.util.AbstractCallTableColumnSortListener$CallComparator" /> + <Bug pattern="SE_INNER_CLASS" /> + </Match> + </FindBugsFilter> \ No newline at end of file diff --git a/src/main/java/kieker/diagnosis/mainview/Controller.java b/src/main/java/kieker/diagnosis/mainview/Controller.java index b7af48326dc77ae334cf6a1ccf9de8abb55d16a1..8507723047549e27e97243e8426b58c0ab1db132 100644 --- a/src/main/java/kieker/diagnosis/mainview/Controller.java +++ b/src/main/java/kieker/diagnosis/mainview/Controller.java @@ -129,7 +129,7 @@ public final class Controller implements SelectionListener { } } - private void handlePotentialTreeSelection(final SelectionEvent e) { + private void handlePotentialTreeSelection(final SelectionEvent e) { // NOPMD (this method violates some metrics. This is acceptable, as it is readable) if (e.item == this.mainView.getTrtmExplorer()) { this.mainViewModel.setCurrentActiveSubView(SubView.NONE.name()); } diff --git a/src/main/java/kieker/diagnosis/subview/Filter.java b/src/main/java/kieker/diagnosis/subview/Filter.java index b3483be50a2fee9b4bf94cc00cbd4a0098c004ad..0393eeb0e11b2625d8459024190a658c594b821e 100644 --- a/src/main/java/kieker/diagnosis/subview/Filter.java +++ b/src/main/java/kieker/diagnosis/subview/Filter.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview; public enum Filter { diff --git a/src/main/java/kieker/diagnosis/subview/aggregatedcalls/Controller.java b/src/main/java/kieker/diagnosis/subview/aggregatedcalls/Controller.java index bb434eb2cc5b4d9f412da68d290cf150f9419b66..ae92716e68b264a550bac1a4a37f4175e639c3bc 100644 --- a/src/main/java/kieker/diagnosis/subview/aggregatedcalls/Controller.java +++ b/src/main/java/kieker/diagnosis/subview/aggregatedcalls/Controller.java @@ -61,7 +61,24 @@ public final class Controller implements ISubController, SelectionListener { } private static IModel<OperationCall> createModelProxy(final DataModel dataModel, final Filter filter) { - return new OperationCallsModelProxy(dataModel); + if (filter == Filter.JUST_FAILED) { + return new FailedOperationCallsModelProxy(dataModel); + } else { + return new OperationCallsModelProxy(dataModel); + } + } + + private static final class FailedOperationCallsModelProxy extends AbstractDataModelProxy<OperationCall> { + + public FailedOperationCallsModelProxy(final DataModel dataModel) { + super(dataModel); + } + + @Override + public List<OperationCall> getContent() { + return super.getDataModel().getFailedOperationCalls(); + } + } private static final class OperationCallsModelProxy extends AbstractDataModelProxy<OperationCall> { diff --git a/src/main/java/kieker/diagnosis/subview/aggregatedcalls/View.java b/src/main/java/kieker/diagnosis/subview/aggregatedcalls/View.java index bcb6dbd91b183d5951caf54be48132d03e7d8490..5edcddc57938e301ece307d982d1283c87b9377c 100644 --- a/src/main/java/kieker/diagnosis/subview/aggregatedcalls/View.java +++ b/src/main/java/kieker/diagnosis/subview/aggregatedcalls/View.java @@ -1,8 +1,26 @@ +/*************************************************************************** + * 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.diagnosis.subview.aggregatedcalls; +import java.util.List; import java.util.Observable; import java.util.Observer; +import kieker.diagnosis.common.domain.AggregatedOperationCall; import kieker.diagnosis.common.domain.OperationCall; import kieker.diagnosis.common.model.PropertiesModel; import kieker.diagnosis.subview.ISubView; @@ -13,12 +31,13 @@ import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.wb.swt.SWTResourceManager; -public class View implements ISubView, Observer { +public final class View implements ISubView, Observer { private static final String N_A = "N/A"; private Composite composite; @@ -37,8 +56,17 @@ public class View implements ISubView, Observer { private Composite statusBar; private Label lblTraceEquivalence; private Table table; + private final Model model; + private final IModel<OperationCall> modelProxy; + private final PropertiesModel propertiesModel; + private final Controller controller; public View(final IModel<OperationCall> modelProxy, final Model model, final PropertiesModel propertiesModel, final Controller controller) { + this.model = model; + this.modelProxy = modelProxy; + this.propertiesModel = propertiesModel; + this.controller = controller; + modelProxy.addObserver(this); model.addObserver(this); propertiesModel.addObserver(this); @@ -190,6 +218,8 @@ public class View implements ISubView, Observer { this.lblTraceEquivalence = new Label(this.statusBar, SWT.NONE); this.lblTraceEquivalence.setText("0 Aggregated Operation Calls"); + + this.table.addSelectionListener(this.controller); } @Override @@ -198,9 +228,71 @@ public class View implements ISubView, Observer { } @Override - public void update(final Observable arg0, final Object arg1) { - // TODO Auto-generated method stub + public void update(final Observable observable, final Object obj) { + if (observable == this.modelProxy) { + this.updateTable(); + this.updateStatusBar(); + } + if (observable == this.model) { + this.updateDetailComposite(); + } + if (observable == this.propertiesModel) { + this.clearTable(); + } + } + + private void updateStatusBar() { + this.lblTraceEquivalence.setText(this.modelProxy.getContent().size() + " Aggregated Operation Call(s)"); + this.statusBar.getParent().layout(); + } + + private void updateTable() { + final List<OperationCall> calls = this.modelProxy.getContent(); + + this.table.setData(calls); + this.table.setItemCount(calls.size()); + this.clearTable(); + } + + private void clearTable() { + this.table.clearAll(); + + for (final TableColumn column : this.table.getColumns()) { + column.pack(); + } + } + + private void updateDetailComposite() { + final AggregatedOperationCall call = this.model.getCurrentActiveCall(); + + final String minDuration = (call.getMinDuration() + " " + this.modelProxy.getShortTimeUnit()).trim(); + final String maxDuration = (call.getMaxDuration() + " " + this.modelProxy.getShortTimeUnit()).trim(); + final String meanDuration = (call.getMeanDuration() + " " + this.modelProxy.getShortTimeUnit()).trim(); + final String avgDuration = (call.getAvgDuration() + " " + this.modelProxy.getShortTimeUnit()).trim(); + final String totalDuration = (call.getTotalDuration() + " " + this.modelProxy.getShortTimeUnit()).trim(); + + this.lblMinimalDurationDisplay.setText(minDuration); + this.lblMaximalDurationDisplay.setText(maxDuration); + this.lblAverageDurationDisplay.setText(avgDuration); + this.lblMeanDurationDisplay.setText(meanDuration); + this.lblTotalDurationDisplay.setText(totalDuration); + + this.lblExecutionContainerDisplay.setText(call.getContainer()); + this.lblComponentDisplay.setText(call.getComponent()); + this.lblOperationDisplay.setText(call.getOperation()); + this.lblNumberOfCallsDisplay.setText(Integer.toString(call.getCalls())); + + if (call.isFailed()) { + this.lblFailedDisplay.setText("Yes (" + call.getFailedCause() + ")"); + this.lblFailedDisplay.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); + this.lblFailed.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); + } else { + this.lblFailedDisplay.setText("No"); + this.lblFailedDisplay.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK)); + this.lblFailed.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK)); + } + this.detailComposite.layout(); } } diff --git a/src/main/java/kieker/diagnosis/subview/calls/View.java b/src/main/java/kieker/diagnosis/subview/calls/View.java index 62a91f301f624731e41e96f7aeeea96ebef4340d..37aeb5a7d76112af8e29ad423296d4e7d3849fa1 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/View.java +++ b/src/main/java/kieker/diagnosis/subview/calls/View.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls; import java.util.List; @@ -32,7 +48,7 @@ import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; import org.eclipse.wb.swt.SWTResourceManager; -public class View implements ISubView, Observer { +public final class View implements ISubView, Observer { private static final String N_A = "N/A"; private Composite composite; diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/ComponentSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/ComponentSortListener.java index 3db3d6f974ff33455085bf4cb3e371890d364b2e..13c867076f8e82d48964ce051f9313d58d44fa67 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/util/ComponentSortListener.java +++ b/src/main/java/kieker/diagnosis/subview/calls/util/ComponentSortListener.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls.util; import kieker.diagnosis.common.domain.OperationCall; diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/ContainerSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/ContainerSortListener.java index 56ed25a8e360f74c208e4287c78ee1ff5c6dfd82..28204a842af5ef6aa8ae3f2846d77b3ac0d622aa 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/util/ContainerSortListener.java +++ b/src/main/java/kieker/diagnosis/subview/calls/util/ContainerSortListener.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls.util; import kieker.diagnosis.common.domain.OperationCall; diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/DurationSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/DurationSortListener.java index d11ea75341ec080fef50c8d903ab67a7c18acb7f..3d8ea8edb9965120f3594a6e7d0d7f4daf6d54cd 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/util/DurationSortListener.java +++ b/src/main/java/kieker/diagnosis/subview/calls/util/DurationSortListener.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls.util; import kieker.diagnosis.common.domain.OperationCall; diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/OperationSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/OperationSortListener.java index bc7a9da591fec3bb27147535033908502909ffef..d9e1c037176250d488d1b503daaafea2db5b58a2 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/util/OperationSortListener.java +++ b/src/main/java/kieker/diagnosis/subview/calls/util/OperationSortListener.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls.util; import kieker.diagnosis.common.domain.OperationCall; diff --git a/src/main/java/kieker/diagnosis/subview/calls/util/TraceIDSortListener.java b/src/main/java/kieker/diagnosis/subview/calls/util/TraceIDSortListener.java index 473e0b1c641c6cbfbb200da4c015b38c716aa1ed..aff55b231c921708b09bdca34f5deb18f73ad88a 100644 --- a/src/main/java/kieker/diagnosis/subview/calls/util/TraceIDSortListener.java +++ b/src/main/java/kieker/diagnosis/subview/calls/util/TraceIDSortListener.java @@ -1,3 +1,19 @@ +/*************************************************************************** + * 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.diagnosis.subview.calls.util; import kieker.diagnosis.common.domain.OperationCall;