Summary: | Ability to suppress generation of specific samples | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Hari Krishna Dara <haridara> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED DUPLICATE | ||
Severity: | enhancement | CC: | akostadinov, p.mouawad |
Priority: | P2 | ||
Version: | 2.6 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 54846 |
Description
Hari Krishna Dara
2012-12-20 09:34:16 UTC
(In reply to comment #0) > I would like to request the ability to programmatically mark specific > samples to be not recorded. Looking at the code, this could be very > straight-forward. E.g., in JMeterThread.process_sample(), call > threadContext.getPreviousResult() right before calling notifyListeners() and > skip it if is null. This way, a BeanShellAssertion could call > ctx.setPreviousResult(null). > Currently you can ignore Requests using include/exclude patterns in JMeter Proxy Server. Can you clarify why you would want to do that ? > BTW, in the documentation at > http://jmeter.apache.org/usermanual/test_plan.html#executionorder it > indicates that the listeners are skipped if SampleResult is null, but I > don't see the check in the code. Can you point to the exact phrase that says that ? (In reply to comment #1) > Currently you can ignore Requests using include/exclude patterns in JMeter > Proxy Server. > Can you clarify why you would want to do that ? I am not talking about the recording time... but rather at runtime, specifically when using BeanShell elements such as "BeanShell Assertion", "BeanShell Sampler". These are really useful to manipulate the run and go beyond the standard behavior, and I would like that to include the control on whether sample should be recorded or not. Right now, TestAction is the only one that doesn't appear in the results, this is because, it's sample() method unconditionally returns null for result. If I can manipulate the result the way I was suggesting before, or even mark it as to be discarded (e.g., by calling SampleResult.setDiscard(true)), it will provide an option to control their appearance in the final results. > > > BTW, in the documentation at > > http://jmeter.apache.org/usermanual/test_plan.html#executionorder it > > indicates that the listeners are skipped if SampleResult is null, but I > > don't see the check in the code. > > Can you point to the exact phrase that says that ? I was referring to this: "unless SampleResult is null" However, I found the code in JMeterThread that checks the result for null and skip the documented steps, so there is nothing wrong here. *** Bug 54846 has been marked as a duplicate of this bug. *** Notes from duplocate bug Sometimes it is desirable to ignore particular samples where you do some setup that is not interesting to be recorded. For example login and similar. Changing layout of test plan often does not look nice. I think org.apache.jmeter.samplers.SampleResult can be extended to have a property ignore or ignoreByListeners. For scripting samplers one can set that property. And for other samplers the transaction controller can be extended to support marking it's parent sample to be ignored so one can put any samples to be ignored under a transaction controller. Regards Note that a SetUp group should normally be used for this purpose, in which case the samples will not be saved by Listeners in t5he main thread group. Also only Samplers generate samples, so it is possible to use (e.g.) a BeanShell PreProcessor to do the setup. This is possible since 4.0 through: SampleResult#setIgnore() *** This bug has been marked as a duplicate of bug 61806 *** This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3021 |