Delay Between Http Requests

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Delay Between Http Requests

Nayak, Soumya R.
Hi All,

Can you please let me know like what is the best way to put delay between HTTP requests.
In bean shell sampler pre processor I had used  "Thread.sleep(millis) " , what I observed was if I run using one user and after coming of the response it sleeps for the specified time and then sends.

Is there anything where we can send requests exactly at the specified time without considering the response time of the previous requests.

For example : I submitted a HTTP request with one user at 1:00:00 PM and the response came at 1:00:50 PM , now my thread will sleep (let say delay of 60 seconds) and fire another http request at 1:01:50 Pm but my requirement is to fire the request at exactly 1:01:00 PM rather than considering the 50 seconds of response time.

Is there any way of achieving this?
Also please let me know if in JMeter its possible to submit requests asynchronously?

Regards,
Soumya

******************************************************************************************
This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

If you received this email as a commercial message and would like to opt out of future commercial
messages, please let us know and we will remove you from our distribution list.

Thank you.~
******************************************************************************************
FAFLD
Reply | Threaded
Open this post in threaded view
|

Re: Delay Between Http Requests

Ivan Rancati-3
Would a Constant Throughput Timer
http://jmeter.apache.org/usermanual/component_reference.html#Constant_Throughput_Timer
work for you?

Best regards

On Sat, Sep 15, 2018 at 6:13 AM Nayak, Soumya R. <[hidden email]> wrote:

> Hi All,
>
> Can you please let me know like what is the best way to put delay between
> HTTP requests.
> In bean shell sampler pre processor I had used  "Thread.sleep(millis) " ,
> what I observed was if I run using one user and after coming of the
> response it sleeps for the specified time and then sends.
>
> Is there anything where we can send requests exactly at the specified time
> without considering the response time of the previous requests.
>
> For example : I submitted a HTTP request with one user at 1:00:00 PM and
> the response came at 1:00:50 PM , now my thread will sleep (let say delay
> of 60 seconds) and fire another http request at 1:01:50 Pm but my
> requirement is to fire the request at exactly 1:01:00 PM rather than
> considering the 50 seconds of response time.
>
> Is there any way of achieving this?
> Also please let me know if in JMeter its possible to submit requests
> asynchronously?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Re: Delay Between Http Requests

deicool
In reply to this post by Nayak, Soumya R.
if i may ask, why is there such a requirement? it might lead to unnecessary
queuing at the server leading to an exponential increase in response time

On Sat, 15 Sep 2018, 09:43 Nayak, Soumya R., <[hidden email]> wrote:

> Hi All,
>
> Can you please let me know like what is the best way to put delay between
> HTTP requests.
> In bean shell sampler pre processor I had used  "Thread.sleep(millis) " ,
> what I observed was if I run using one user and after coming of the
> response it sleeps for the specified time and then sends.
>
> Is there anything where we can send requests exactly at the specified time
> without considering the response time of the previous requests.
>
> For example : I submitted a HTTP request with one user at 1:00:00 PM and
> the response came at 1:00:50 PM , now my thread will sleep (let say delay
> of 60 seconds) and fire another http request at 1:01:50 Pm but my
> requirement is to fire the request at exactly 1:01:00 PM rather than
> considering the 50 seconds of response time.
>
> Is there any way of achieving this?
> Also please let me know if in JMeter its possible to submit requests
> asynchronously?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Re: Delay Between Http Requests

shettyd
In reply to this post by Nayak, Soumya R.
>https://jmeter.apache.org/usermanual/component_reference.html#timers
You could also use the JSR223 timer to read the current time and determine
how much delay to return. You do however need to figure out what you want
to do when your previous sampler takes more than (in your example) 1 minute
since the window has already passed.

>Also please let me know if in JMeter its possible to submit requests
asynchronously?
Only if you are willing to code it yourself in for e.g. a java sampler -
The default HTTP requests do not have this feature.
See this for some other options -
https://www.blazemeter.com/blog/how-to-load-test-async-requests-with-jmeter

On Fri, Sep 14, 2018 at 9:13 PM Nayak, Soumya R. <[hidden email]> wrote:

> Hi All,
>
> Can you please let me know like what is the best way to put delay between
> HTTP requests.
> In bean shell sampler pre processor I had used  "Thread.sleep(millis) " ,
> what I observed was if I run using one user and after coming of the
> response it sleeps for the specified time and then sends.
>
> Is there anything where we can send requests exactly at the specified time
> without considering the response time of the previous requests.
>
> For example : I submitted a HTTP request with one user at 1:00:00 PM and
> the response came at 1:00:50 PM , now my thread will sleep (let say delay
> of 60 seconds) and fire another http request at 1:01:50 Pm but my
> requirement is to fire the request at exactly 1:01:00 PM rather than
> considering the 50 seconds of response time.
>
> Is there any way of achieving this?
> Also please let me know if in JMeter its possible to submit requests
> asynchronously?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Re: Delay Between Http Requests

glinius@live.com
In reply to this post by Nayak, Soumya R.
You must be looking for implementation of dynamic  pacing
<https://www.quora.com/What-is-the-difference-between-think-time-and-pacing-in-performance-testing>  
which can be done using some  Groovy scripting in the JSR223 Timer
<https://www.blazemeter.com/blog/how-to-easily-implement-pacing-jmeter>  




--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]