Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoscroll, preferred width and selected sampler name in ViewResultsTree listener #6245

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/jmeter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,12 @@ view.results.tree.renderers_order=.RenderAsText,.RenderAsRegexp,.RenderAsBoundar
# Set to 0 to store all results (might consume a lot of memory)
#view.results.tree.max_results=500

# Set to true to enable by default the checkbox for 'Scroll automatically?'.
#view.results.tree.autoscroll=false

# Default width of the scroll view
#view.results.tree.width=250

# Maximum size of Document that can be parsed by Tika engine; default=10 * 1024 * 1024 (10 MB)
# Set to 0 to disable the size check
#document.max_size=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ public void setupTabPane() {
.append(JMeterUtils
.getResString("view_results_thread_name")) //$NON-NLS-1$
.append(sampleResult.getThreadName()).append(NL);
statsBuff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be mentioned in the title of this PR. Was this intended to be included?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, this was an later add-on. Purpose is: dealing with a long samplers listing in a View Results Tree one can easily lose relation between scroll on left side and selected sampler on right side.
Having the sampler name included can help in tracking between the 2 sources of information.
I will update PR title.

.append(JMeterUtils
.getResString("view_results_sample_name")) //$NON-NLS-1$
.append(sampleResult.getSampleLabel()).append(NL);
String startTime = dateFormat
.format(Instant.ofEpochMilli(sampleResult.getStartTime()));
statsBuff
Expand Down Expand Up @@ -369,6 +373,10 @@ public void setupTabPane() {
resultModel.addRow(new RowResult(
JMeterUtils.getParsedLabel("view_results_thread_name"), //$NON-NLS-1$
sampleResult.getThreadName()));
resultModel.addRow(new RowResult(
JMeterUtils.getParsedLabel(
"view_results_sample_name"), //$NON-NLS-1$
sampleResult.getSampleLabel()));
resultModel.addRow(new RowResult(
JMeterUtils.getParsedLabel("view_results_sample_start"), //$NON-NLS-1$
startTime));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ public class ViewResultsFullVisualizer extends AbstractVisualizer
private static final String VIEWERS_ORDER =
JMeterUtils.getPropDefault("view.results.tree.renderers_order", ""); // $NON-NLS-1$ //$NON-NLS-2$

//default scroll checkbox status
private static final boolean SCROLL_CHECKBOX = JMeterUtils.getPropDefault("view.results.tree.autoscroll", false);

// default tree scroll width
private static final int SCROLL_WIDTH = JMeterUtils.getPropDefault("view.results.tree.width", 250); // $NON-NLS-1$

private static final int REFRESH_PERIOD = JMeterUtils.getPropDefault("jmeter.gui.refresh_period", 500);

private static final ImageIcon imageSuccess = JMeterUtils.getImage(
Expand Down Expand Up @@ -431,13 +437,13 @@ private synchronized Component createLeftPanel() {
jTree.setRootVisible(false);
jTree.setShowsRootHandles(true);
JScrollPane treePane = new JScrollPane(jTree);
treePane.setPreferredSize(new Dimension(200, 300));
treePane.setPreferredSize(new Dimension(SCROLL_WIDTH, 300));

VerticalPanel leftPane = new VerticalPanel();
leftPane.add(treePane, BorderLayout.CENTER);
leftPane.add(createComboRender(), BorderLayout.NORTH);
autoScrollCB = new JCheckBox(JMeterUtils.getResString("view_results_autoscroll")); // $NON-NLS-1$
autoScrollCB.setSelected(false);
autoScrollCB.setSelected(SCROLL_CHECKBOX);
autoScrollCB.addItemListener(this);
leftPane.add(autoScrollCB, BorderLayout.SOUTH);
return leftPane;
Expand Down
8 changes: 8 additions & 0 deletions xdocs/usermanual/properties_reference.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,14 @@ JMETER-SERVER</source>
Can be switched off by setting the value to <code>-1</code>.<br/>
Defaults to: <code>10000</code>
</property>
<property name="view.results.tree.autoscroll">
Set to <code>true</code> to enable by default the checkbox for 'Scroll automatically?'.<br/>
Defaults to: <code>false</code>
</property>
<property name="view.results.tree.width">
Default width of the scroll view.<br/>
Defaults to: <code>250</code>
</property>
<property name="document.max_size">
Maximum size (in bytes) of Document that can be parsed by Tika engine<br/>
Set to zero to disable the size check.<br/>
Expand Down