Bug 58784 - Use invokeLater in JMeterUtils#runSafe
Summary: Use invokeLater in JMeterUtils#runSafe
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.13
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-30 15:13 UTC by Felix Schumacher
Modified: 2016-01-01 19:23 UTC (History)
0 users



Attachments
Use invokeLater instead of invokeAndWait (1.15 KB, patch)
2015-12-30 15:13 UTC, Felix Schumacher
Details | Diff
Use invokeLater instead of invokeAndWait everywhere except in proxycontrol (11.17 KB, patch)
2016-01-01 12:41 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schumacher 2015-12-30 15:13:28 UTC
Created attachment 33386 [details]
Use invokeLater instead of invokeAndWait

The usage of invokeAndWait in runSafe will slow down the samplers in gui mode, when listeners are used.

When running with 1000 threads in 500 loops using just a simple java sampler (0ms wait) and a Summary Report the version with invokeAndWait will do about 30.000 req/s and the one with invokeLater around 100.000 req/s. (Tested on my ubunutu notebook with local X).

When run over remote X the version with invokeAndWait can perform a lot worse, due to heavy lock contention.

The proposed patch ignores the potentially thrown exceptions, as they are probably ignored by the other usages of invokeLater in other parts of jmeter code.
Comment 1 Felix Schumacher 2016-01-01 12:41:35 UTC
Created attachment 33390 [details]
Use invokeLater instead of invokeAndWait everywhere except in proxycontrol

As pointed out by Phillip, the proxy control has problems when runSafe is asynchronous. So leave runSafe synchronous per default, but add a version which is configurable, whether it should do the runnable synchronously or asynchronously.
Comment 2 Felix Schumacher 2016-01-01 12:53:59 UTC
Date: Fri Jan  1 12:51:20 2016
New Revision: 1722493

URL: http://svn.apache.org/viewvc?rev=1722493&view=rev
Log:
Make JMeterUtils#runSafe sync/async awt invocation configurable and
change the visualizers to use the async version.

Bugzilla Id: 58784

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/AssertionVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/ComparisonVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/GraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Felix Schumacher 2016-01-01 19:23:58 UTC
Date: Fri Jan  1 19:21:40 2016
New Revision: 1722543

URL: http://svn.apache.org/viewvc?rev=1722543&view=rev
Log:
Correct (flip) sync/async usage of JMeterUtils#runSafe as noted by pmouawad.

Followup to r1722493

Bugzilla Id: 58784