- How to exclude the response time of a sampler from a transaction response time?
- How to eliminate a sampler from the listener in JMeter?
In JMeter, some of the samplers like JSR223 or BeanShell samplers contain an operational logic code. Such a sampler takes time to process the logic and gives the output. Ideally, the processing time of JSR223 or BeanShell sampler should not be included in the transaction response time because it impacts the response time metric. Hence we need to exclude the response time of these samplers from the result.
The processing time of JSR223 or BeanShell samplers increases the transaction response time or overall response time which may lead to breach the response time NFR of the transaction.
Follow the below steps to exclude the response time of a sampler:
- Add a ‘JSR223 PostProcessor’ under that sampler whose processing time needs to be excluded
- Write the code ‘prev.setIgnore()’ in JSR223 PostProcessor
How does it work?
The method setIgnore() belongs to SampleResult class of JMeter which instructs JMeter not to calculate the response time of the sampler. Hence the sampler is out from the listener’s list.