run a script every 5 seconds

View: New views
5 Messages — Rating Filter:   Alert me  

run a script every 5 seconds

by Irfan Mohammed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
Thanks for the excellent tool.

I have a question regarding configuring grinder to start a test script which runs every 5 seconds?

The script itself can run for more than 5 seconds. The key thing is that there should be a new request for a web page every 5 seconds.

Thanks.
Irfan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Parent Message unknown Re: run a script every 5 seconds

by VAN GIEL Marc-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Irfan,

You could use the grinder increment properties:

grinder.processes=20

# one thread per process
grinder.threads=1

# run every test once
grinder.runs=1

# number of processes to start with
grinder.initialProcesses=1

# number of processes to spawn after interval
grinder.processIncrement=1

# interval in ms (in this case 5 sec)
grinder.processIncrementInterval=5000


If you configure it like this, every test runs once, and after every 5 seconds a new test (request) is launched, doing this 20 times.

Regards,
Marc.



On Thu, Jun 5, 2008 at 10:19 PM, Irfan Mohammed  wrote:
Hi,
Thanks for the excellent tool.

I have a question regarding configuring grinder to start a test script which runs every 5 seconds?

The script itself can run for more than 5 seconds. The key thing is that there should be a new request for a web page every 5 seconds.

Thanks.
Irfan



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: run a script every 5 seconds

by Irfan Mohammed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the snippet. That helped.

Marc Van Giel wrote:

> Hi Irfan,
>
> You could use the grinder increment properties:
>
> grinder.processes=20
>
> # one thread per process
> grinder.threads=1
>
> # run every test once
> grinder.runs=1
>
> # number of processes to start with
> grinder.initialProcesses=1
>
> # number of processes to spawn after interval
> grinder.processIncrement=1
>
> # interval in ms (in this case 5 sec)
> grinder.processIncrementInterval=5000
>
>
> If you configure it like this, every test runs once, and after every 5
> seconds a new test (request) is launched, doing this 20 times.
>
> Regards,
> Marc.
>
>
>
>     On Thu, Jun 5, 2008 at 10:19 PM, Irfan Mohammed  wrote:
>
>         Hi,
>         Thanks for the excellent tool.
>
>         I have a question regarding configuring grinder to start a test
>         script which runs every 5 seconds?
>
>         The script itself can run for more than 5 seconds. The key thing
>         is that there should be a new request for a web page every 5
>         seconds.
>
>         Thanks.
>         Irfan
>
>
>
>         --
>         This message has been scanned for viruses and
>         dangerous content by MailScanner, and is
>         believed to be clean.
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: run a script every 5 seconds

by Irfan Mohammed-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

follow up on this question ...

The script which runs every 5 seconds should pick the url that needs to be requested from a pool of urls.

urls :
  url-1
  url-2
  url-3

Script @ 10:00 should request url-1
Script @ 10:05 should request url-2
Script @ 10:10 should request url-3

does grinder provide a way to this kind of processing out of the box?

Thanks.

Marc Van Giel wrote:

> Hi Irfan,
>
> You could use the grinder increment properties:
>
> grinder.processes=20
>
> # one thread per process
> grinder.threads=1
>
> # run every test once
> grinder.runs=1
>
> # number of processes to start with
> grinder.initialProcesses=1
>
> # number of processes to spawn after interval
> grinder.processIncrement=1
>
> # interval in ms (in this case 5 sec)
> grinder.processIncrementInterval=5000
>
>
> If you configure it like this, every test runs once, and after every 5
> seconds a new test (request) is launched, doing this 20 times.
>
> Regards,
> Marc.
>
>
>
>     On Thu, Jun 5, 2008 at 10:19 PM, Irfan Mohammed  wrote:
>
>         Hi,
>         Thanks for the excellent tool.
>
>         I have a question regarding configuring grinder to start a test
>         script which runs every 5 seconds?
>
>         The script itself can run for more than 5 seconds. The key thing
>         is that there should be a new request for a web page every 5
>         seconds.
>
>         Thanks.
>         Irfan
>
>
>
>         --
>         This message has been scanned for viruses and
>         dangerous content by MailScanner, and is
>         believed to be clean.
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> grinder-use mailing list
> grinder-use@...
> https://lists.sourceforge.net/lists/listinfo/grinder-use

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Re: run a script every 5 seconds

by Philip Aston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Irfan Mohammed wrote:

> follow up on this question ...
>
> The script which runs every 5 seconds should pick the url that needs to be requested from a pool of urls.
>
> urls :
>   url-1
>   url-2
>   url-3
>
> Script @ 10:00 should request url-1
> Script @ 10:05 should request url-2
> Script @ 10:10 should request url-3
>
> does grinder provide a way to this kind of processing out of the box
>  

No, but it should be simple enough to script.

Taking what you request literally (i.e. assuming you are running a
separate instance of the script every 5 minutes) you could do something
like this:


from net.grinder.plugin.http import HTTPRequest
from time import localtime

urls = [
"http://url-1",
"http://url-2",
"http://url-3",
]

request = HTTPRequest()

class TestRunner:
  def __call__(self):
    seconds = localtime()[5]
    url = urls[seconds % len(urls)]
    request.GET(url)


- Phil


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use