We often need to do some processing with JSR223 elements without wanting the generation of a SampleResult. Sampler which return null SampleResult will not impact results CSV/XML, but JSR223 Sampler cannot do that currently as the SampleResult is created before calling custom code. So what would be the best way to do that: - Add a method setNoResult(boolean) on SampleResult ? calling this from script code would make JSR223Sampler return null. This seems to be the most performing way - Throw some custom exception ? But throwing an exception has a cost and it is done for exceptional case, it's not the case here - Other ideas ?
Was: JSR223 Sampler : There should be a way to make it not impact results
Author: pmouawad Date: Thu Nov 2 22:44:12 2017 New Revision: 1814121 URL: http://svn.apache.org/viewvc?rev=1814121&view=rev Log: Bug 61709 - SampleResult : Add a method setIgnore() to make JMeter ignore the SampleResult and not send it to listeners Bugzilla Id: 61709 Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java jmeter/trunk/xdocs/changes.xml jmeter/trunk/xdocs/usermanual/component_reference.xml
@Philippe Mouawad Hello, I find this new method really usefull for me !!! But I want to use it some time in PostProcessor or Assertion script but it's not possible. Are you Ok if I add a new test in JMeterThread to check this property just before send result to listener ? runPostProcessors(pack.getPostProcessors()); checkAssertions(pack.getAssertions(), result, threadContext); if ( !result.isIgnore() ) { // Do not send subsamples to listeners which receive the transaction sample List<SampleListener> sampleListeners = getSampleListeners(pack, transactionPack, transactionSampler); notifyListeners(sampleListeners, result); }
Hi Maxime, Happy you find it useful :-) Can you create another bugzilla and discuss this on mailing list before ? I'd like other brains to ensure I am not missing something. Thanks
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4559