apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.01k stars 2.03k forks source link

No point in showing the root node in the "View results tree" #1533

Closed asfimport closed 19 years ago

asfimport commented 19 years ago

Heikki Linnakangas (Bug 34649): All sample responses end up as leafs right under the root node, which doesn't represent anything.

Showing the root is pointless, you always want to just open it to see the leafs. The root shouldn't be shown at all.

In fact, it might be a good idea to make the UI component a list instead of a tree.

OS: other

asfimport commented 19 years ago

Heikki Linnakangas (migrated from Bugzilla): Here's a small patch that hides the root node.

Created attachment jmeter-noroot.diff: A patch that hides the root node.

jmeter-noroot.diff ````diff ? jmeter-noroot.diff Index: src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java =================================================================== RCS file: /home/cvspublic/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java,v retrieving revision 1.48 diff -c -r1.48 ViewResultsFullVisualizer.java *** src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java 26 Apr 2005 00:14:45 -0000 1.48 --- src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java 27 Apr 2005 15:10:50 -0000 *************** *** 61,66 **** --- 61,67 ---- import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; + import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; *************** *** 167,172 **** --- 168,177 ---- DefaultMutableTreeNode currNode = new DefaultMutableTreeNode(res); treeModel.insertNodeInto(currNode, root, root.getChildCount()); addSubResults(currNode, res); + + if(root.getChildCount() == 1) + jTree.expandPath(new TreePath(root)); + log.debug("End : updateGui1"); } *************** *** 665,671 **** jTree.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION); jTree.addTreeSelectionListener(this); ! jTree.setShowsRootHandles(true); JScrollPane treePane = new JScrollPane(jTree); treePane.setPreferredSize(new Dimension(200, 300)); --- 670,676 ---- jTree.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION); jTree.addTreeSelectionListener(this); ! jTree.setRootVisible(false); JScrollPane treePane = new JScrollPane(jTree); treePane.setPreferredSize(new Dimension(200, 300)); ````
asfimport commented 19 years ago

Sebb (migrated from Bugzilla): Works OK.

However, when nested results are present (e.g. from HTTP download embedded resources) there is no handle shown for the parent nodes.

The only way to open the node seems to be to double-click on it, which is not as convenient.

I've fixed that by restoring the call to setShowsRootHandles(true).

Can't really use a List instead of a tree because of nested results.

asfimport commented 19 years ago

Sebb (migrated from Bugzilla): Code committed to CVS HEAD

asfimport commented 19 years ago

Heikki Linnakangas (migrated from Bugzilla): (In reply to comment 3)

Code committed to CVS HEAD

Cheers.

You seem to have accidentally inserted a bogus tab character on line 670.

asfimport commented 19 years ago

Sebb (migrated from Bugzilla): Not bogus - it's just that Eclipse is set up with tabs at 4 characters, which is probably not ideal.

The tab does not affect the compiled code.