Commit 00891710 authored by Florian's avatar Florian

improved performance and startet to add jump functionality from aggregated op calls to op calls

parent 92889c11
#Properties file for kieker.tools.eclipse.analysis
command.label.ShowInOpCallTab = Zeige in Methodenaufrufe Tab
command.label.ShowInTraceTab = Zeige in Traces Tab
command.label.ShowTraces = Zeige Traces
command.label.ShowAggregatedTraces = Zeige aggregierte Traces
......
#Properties file for kieker.tools.eclipse.analysis
command.label.ShowInOpCallTab = Show in Operation Call tab
command.label.ShowInTraceTab = Show in Traces tab
command.label.ShowTraces = Show Traces
command.label.ShowAggregatedTraces = Show Aggregated Traces
......
......@@ -31,6 +31,10 @@
id="kieker.tools.eclipse.analysis.commands.selectTraceFromOpCallCommand"
name="SelectTraceFromOpCall">
</command>
<command
id="kieker.tools.eclipse.analysis.commands.selectOpCallFromAggrOpCallCommand"
name="SelectOpCallFromAggrOpCall">
</command>
</extension>
<extension
point="org.eclipse.ui.views">
......@@ -157,6 +161,10 @@
class="kieker.tools.eclipse.analysis.handler.SelectTraceFromOpCallHandler"
commandId="kieker.tools.eclipse.analysis.commands.selectTraceFromOpCallCommand">
</handler>
<handler
class="kieker.tools.eclipse.analysis.handler.SelectOpCallsFromAggregatedOpCallHandler"
commandId="kieker.tools.eclipse.analysis.commands.selectOpCallFromAggrOpCallCommand">
</handler>
</extension>
<extension
......@@ -224,7 +232,25 @@
operator="and">
<test
forcePluginActivation="true"
property="kieker.tools.eclipse.analysis.helper.opCallTabTester.checkTab">
property="kieker.tools.eclipse.analysis.helper.opCallTabTester.checkOpCallTab">
</test>
</iterate>
</with>
</visibleWhen>
</command>
<command
commandId="kieker.tools.eclipse.analysis.commands.selectOpCallFromAggrOpCallCommand"
label="%command.label.ShowInOpCallTab"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<iterate
operator="and">
<test
forcePluginActivation="true"
property="kieker.tools.eclipse.analysis.helper.aggrOpCallTabTester.checkAggrOpCallTab">
</test>
</iterate>
</with>
......@@ -245,9 +271,16 @@
class="kieker.tools.eclipse.analysis.helper.OpCallTabTester"
id="kieker.tools.eclipse.analysis.helper.opCallTabTester"
namespace="kieker.tools.eclipse.analysis.helper.opCallTabTester"
properties="checkTab"
properties="checkOpCallTab"
type="kieker.analysis.domain.OperationCall">
</propertyTester>
<propertyTester
class="kieker.tools.eclipse.analysis.helper.OpCallTabTester"
id="kieker.tools.eclipse.analysis.helper.aggrOpCallTabTester"
namespace="kieker.tools.eclipse.analysis.helper.aggrOpCallTabTester"
properties="checkAggrOpCallTab"
type="kieker.analysis.domain.AggregatedOperationCall">
</propertyTester>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
......
......@@ -50,7 +50,7 @@ public abstract class AbstractFolderSelectionHandler extends AbstractHandler {
if (partView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) partView;
view.setFocus(focusOnTab);
view.setInputs();
view.setInputs(focusOnTab);
}
}
......
package kieker.tools.eclipse.analysis.handler;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
import kieker.analysis.domain.AggregatedOperationCall;
import kieker.analysis.domain.OperationCall;
import kieker.tools.eclipse.analysis.provider.DataProvider;
import kieker.tools.eclipse.analysis.view.AnalysisTreeView;
public class SelectOpCallsFromAggregatedOpCallHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
IViewPart partView = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
.showView(AnalysisTreeView.VIEWNAME);
ISelection sel = HandlerUtil.getCurrentSelection(event);
if (sel instanceof IStructuredSelection) {
Object selected= ((IStructuredSelection) sel).getFirstElement();
if (selected instanceof AggregatedOperationCall) {
AggregatedOperationCall aggrOpCall = (AggregatedOperationCall) selected;
String container = aggrOpCall.getContainer();
String component = aggrOpCall.getComponent();
String operation = aggrOpCall.getOperation();
List<TreePath> path = new ArrayList<TreePath>();
List<OperationCall> opCalls = DataProvider.getOperationCalls();
for(OperationCall opCall : opCalls){
if(container.equals(opCall.getContainer()) && component.equals(opCall.getComponent()) && operation.equals(opCall.getOperation())){
path.add(new TreePath(new Object[]{opCall}));
}
}
TreePath[] pathArray = new TreePath[path.size()];
for(int i = 0; i<path.size(); i++){
pathArray[i] = path.get(i);
}
if (partView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) partView;
List<ColumnViewer> viewer = view.getViewerList();
ColumnViewer colView = viewer.get(AnalysisTreeView.OPCALLTAB);
colView.setSelection(new TreeSelection(pathArray), true);
view.setFocus(AnalysisTreeView.OPCALLTAB);
}
}
}
} catch (PartInitException e) {
e.printStackTrace();
}
return null;
}
}
......@@ -38,9 +38,9 @@ public class SelectTraceFromOpCallHandler extends AbstractHandler {
if (partView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) partView;
List<ColumnViewer> viewer = view.getViewerList();
ColumnViewer colView = viewer.get(0);
ColumnViewer colView = viewer.get(AnalysisTreeView.TRACETAB);
colView.setSelection(new TreeSelection(new TreePath(path.toArray())), true);
view.setFocus(0);
view.setFocus(AnalysisTreeView.TRACETAB);
}
}
}
......
......@@ -5,6 +5,7 @@ import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;
import kieker.analysis.domain.AggregatedOperationCall;
import kieker.analysis.domain.OperationCall;
import kieker.tools.eclipse.analysis.view.AnalysisTreeView;
......@@ -16,7 +17,7 @@ public class OpCallTabTester extends PropertyTester {
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if ("checkTab".equals(property)) {
if ("checkOpCallTab".equals(property)) {
if (receiver instanceof OperationCall) {
IViewPart analysisView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.findView(AnalysisTreeView.VIEWNAME);
......@@ -29,6 +30,20 @@ public class OpCallTabTester extends PropertyTester {
}
}
}
} else if("checkAggrOpCallTab".equals(property)){
if (receiver instanceof AggregatedOperationCall) {
IViewPart analysisView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.findView(AnalysisTreeView.VIEWNAME);
if (analysisView instanceof AnalysisTreeView) {
AnalysisTreeView view = (AnalysisTreeView) analysisView;
TabFolder tabFolder = view.getTabFolder();
if (tabFolder.getSelectionIndex() == AnalysisTreeView.AGGROPCALLTAB) {
return true;
}
}
}
}
return false;
......
......@@ -3,7 +3,9 @@ package kieker.tools.eclipse.analysis.view;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.action.MenuManager;
......@@ -43,6 +45,12 @@ import kieker.tools.eclipse.analysis.model.ColumnDef;
public abstract class AbstractJFaceView extends ViewPart {
protected ImageRegistry ir;
private List<TreeFilter> treeFilterList = new ArrayList<>();
public List<TreeFilter> getTreeFilterList() {
return treeFilterList;
}
@Override
public void createPartControl(Composite parent) {
......@@ -69,11 +77,10 @@ public abstract class AbstractJFaceView extends ViewPart {
composite.setLayout(new FillLayout());
TreeFilter filter = new TreeFilter();
FilteredTree filteredTree = new FilteredTree(composite, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL,
treeFilterList.add(filter);
FilteredTree filteredTree = new FilteredTree(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL,
filter, true);
TreeViewer viewer = filteredTree.getViewer();
tab.setControl(composite);
Tree tree = viewer.getTree();
......
......@@ -61,6 +61,7 @@ public class AnalysisTreeView extends AbstractJFaceView {
public final static int AGGROPCALLTAB = 3;
public final static int MONITORINGSTATSTAB = 4;
boolean inputsSet[] = new boolean[5];
TabFolder tabFolder;
......@@ -95,6 +96,10 @@ public class AnalysisTreeView extends AbstractJFaceView {
public void widgetSelected(SelectionEvent e) {
int tabIdx = tabFolder.getSelectionIndex();
selIntermediate.setSelectionProviderDelegate(viewerList.get(tabIdx));
if(!inputsSet[tabIdx]){
setInputs(tabIdx);
}
}
public void widgetDefaultSelected(SelectionEvent e) {
......@@ -119,25 +124,45 @@ public class AnalysisTreeView extends AbstractJFaceView {
}
public void setInputs() {
viewerList.get(TRACETAB).setInput(DataProvider.getTraces());
viewerList.get(AGGRTRACETAB).setInput(DataProvider.getAggregatedTraces());
viewerList.get(OPCALLTAB).setInput(DataProvider.getOperationCalls());
viewerList.get(AGGROPCALLTAB).setInput(DataProvider.getAggreagtedOperationCalls());
viewerList.get(MONITORINGSTATSTAB).setInput(DataProvider.getMonitoringStats());
public void setInputs(int i) {
switch (i) {
case TRACETAB:
viewerList.get(TRACETAB).setInput(DataProvider.getTraces());
break;
case AGGRTRACETAB:
viewerList.get(AGGRTRACETAB).setInput(DataProvider.getAggregatedTraces());
break;
case OPCALLTAB:
viewerList.get(OPCALLTAB).setInput(DataProvider.getOperationCalls());
break;
case AGGROPCALLTAB:
viewerList.get(AGGROPCALLTAB).setInput(DataProvider.getAggreagtedOperationCalls());
break;
case MONITORINGSTATSTAB:
viewerList.get(MONITORINGSTATSTAB).setInput(DataProvider.getMonitoringStats());
break;
default:
break;
}
inputsSet[i] = true;
setTabTitles();
packCols();
}
private void setTabTitles(){
private void setTabTitles() {
TabItem tab = tabList.get(0);
tab.setText(Messages.AnalysisTreeView_Traces + " (" +DataProvider.getTraces().size() +")");
tab.setText(Messages.AnalysisTreeView_Traces + " (" + DataProvider.getTraces().size() + ")");
tab = tabList.get(1);
tab.setText(Messages.AnalysisTreeView_AggregatedTraces + " (" +DataProvider.getAggregatedTraces().size() +")");
tab.setText(
Messages.AnalysisTreeView_AggregatedTraces + " (" + DataProvider.getAggregatedTraces().size() + ")");
tab = tabList.get(2);
tab.setText(Messages.AnalysisTreeView_OpCalls + " (" +DataProvider.getOperationCalls().size() +")");
tab.setText(Messages.AnalysisTreeView_OpCalls + " (" + DataProvider.getOperationCalls().size() + ")");
tab = tabList.get(3);
tab.setText(Messages.AnalysisTreeView_AggregatedOpCalls + " (" +DataProvider.getAggreagtedOperationCalls().size() +")");
tab.setText(Messages.AnalysisTreeView_AggregatedOpCalls + " ("
+ DataProvider.getAggreagtedOperationCalls().size() + ")");
}
private void packCols() {
......@@ -174,7 +199,7 @@ public class AnalysisTreeView extends AbstractJFaceView {
new ColumnDef(Messages.AnalysisTreeView_Failed, new FailedLabelProvider()) };
TraceViewerComparator traceComp = new TraceViewerComparator();
createTreeViewerColumns(viewer, traceComp, colDef);
viewer.setContentProvider(new TraceContentProvider());
......@@ -206,7 +231,7 @@ public class AnalysisTreeView extends AbstractJFaceView {
};
AggregatedTraceViewerComparator aggrTraceComp = new AggregatedTraceViewerComparator();
createTreeViewerColumns(viewer, aggrTraceComp, colDef);
viewer.setContentProvider(new TraceContentProvider());
......@@ -230,7 +255,7 @@ public class AnalysisTreeView extends AbstractJFaceView {
new ColumnDef(Messages.AnalysisTreeView_Failed, new FailedLabelProvider()) };
OperationCallViewerComparator opCallComp = new OperationCallViewerComparator();
createTreeViewerColumns(viewer, opCallComp, colDef);
viewer.setContentProvider(new OperationCallContentProvider());
......@@ -245,7 +270,6 @@ public class AnalysisTreeView extends AbstractJFaceView {
TabItem tab = new TabItem(tabFolder, SWT.NULL);
tab.setText(Messages.AnalysisTreeView_AggregatedOpCalls);
TreeViewer viewer = createTree(tabFolder, tab);
ColumnDef[] colDef = { new ColumnDef(Messages.AnalysisTreeView_Operation, new OperationLabelProvider()),
new ColumnDef(Messages.AnalysisTreeView_Component, new ComponentLabelProvider()),
new ColumnDef(Messages.AnalysisTreeView_Container, new ContainerLabelProvider()),
......@@ -256,7 +280,7 @@ public class AnalysisTreeView extends AbstractJFaceView {
new ColumnDef(Messages.AnalysisTreeView_Max, SWT.RIGHT, new MaxDurationLabelProvider()),
new ColumnDef(Messages.AnalysisTreeView_Mean, SWT.RIGHT, new MeanDurationLabelProvider()),
new ColumnDef(Messages.AnalysisTreeView_Failed, new FailedLabelProvider()) };
AggregatedOperationCallViewerComparator aggrOpCallComp = new AggregatedOperationCallViewerComparator();
createTreeViewerColumns(viewer, aggrOpCallComp, colDef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment