Search code examples
jmeterperformance-testingjmeter-pluginsthroughput

Need to send 1 request in N seconds in jmeter


I want to send 1 request per 10 seconds then reduce it to 1 second per 5 sec like this i want to test performance of the http request. I do not have concern with Threads.

I have tried two different things.

  1. Constant throughput timer Thread count - 5 Target Throughput - 12.0 Calculated throughput - all active threads in current thread group

Result : Jemter screenshot with constant timer

But i want only one request on 11:36:28.337 then second request is on 11:36:33.337 like this.

  1. Throughput shapping timer Start RPS & End RPS = 0.2 Thread group - 5

Results :enter image description here

This result is also not satisfactory.

Please provide me the correct configuration. Thanks in advance for any help.


Solution

  • You need to either reduce number of threads to 1 or use reasonable ramp-up time as:

    • Constant Throughput Timer is precise enough on minute level, don't expect it to pause the threads from the first second, let your test run for a while
    • If you need throughput limitation to be applied from the very beginning of your test make sure 2nd thread (virtual user) will be added not earlier than on 61st second of the test, i.e. set ramp-up time in the Thread Group to something like 300 given you kick off 5 threads.

    Despite its name Constant Throughput Timer doesn't need to be "constant", you can define the desired throughput via JMeter Property using __P() function like ${__P(throughput,)} and amend the property value using i.e. __setProperty() function or even outside JMeter via i.e. Beanshell Server, check out How to Adjust the RPS in Your JMeter Test via the Command Line guide for more details.