>youcan achieve what you described by creating several threads (say 5), each
>containing an IF controller and your sampler
But then you have to synchronize between threads. I.e. ensure 1 and 2 run at
the same time and 5,6,7 run at the same time.
Plus if you need to share the session you have to do more work.

>However, I found that in JMeter (2.4) I cannot put number of threads as a
variable ${THRD}
You need to use properties.

regards
deepak


On Sat, Sep 24, 2011 at 12:36 PM, Nermin CALUK <ner...@atlantbh.com> wrote:

> Hi zjm,
>
> I thought I'd have an elegant solution for you but that one doesn't seem to
> work. Alternatively, if max number of parallel requests is not too big, you
> can achieve what you described by creating several threads (say 5), each
> containing an IF controller and your sampler. Then you create a CSV file in
> which one line contains pairs of values for IF controllers and inputs for
> your requests. This way you can use IF controllers to simply turn on or
> turn
> off any of the samplers - sometimes you'll leave only one on, sometimes
> you'll want all of them to run in parallel. In Test Plan leave "Run threads
> group consecutively" unchecked to make sure your requests will be sent in
> parallel.
>
> Finally, if pause interval between your requests is constant, just add
> Constant Timer on the top level of your plan. If you want variable pauses,
> just enter value of milliseconds as, say, first column in your CSV file and
> then in your Constant Timer put corresponding variable, e.g. ${PAUSE}
>
>
>
>
> Deepak, Oliver, Sebb et al,
>
>
> I tried to achieve this with the following setup:
>
>  -- Test Plan
>  -- CSV [to read the value of number of threads]
>  -- Thread Group [where number of threads is a variable ${THRD}]
>  ---- CSV [to read requests parameters, input]
>  ---- Sampler [to send the requests]
>  -- View Results Tree
>
> My reasoning was: let's read number of threads from one file and let's read
> input data for requests from another CSV file. If number of threads for one
> iteration is 3, than 3 lines would be read from input file and 3 parallel
> requests would be sent. However, I found that in JMeter (2.4) I cannot put
> number of threads as a variable ${THRD} that I read from the CSV file.
> Jmeter.log looks like this:
>
> ...
> 2011/09/24 21:30:47 DEBUG - jmeter.engine.util.ValueReplacer: About to
> replace in property of type: class
> org.apache.jmeter.testelement.property.StringProperty: ${THRD}
> 2011/09/24 21:30:47 DEBUG - jmeter.testelement.property.AbstractProperty:
> Not running version, return raw function string
> 2011/09/24 21:30:47 DEBUG - jmeter.engine.util.ValueReplacer: Replacement
> result: ${THRD}
> ...
> 2011/09/24 21:30:47 INFO  - jmeter.gui.util.JMeterMenuBar:
> setRunning(true,*local*)
> 2011/09/24 21:30:47 DEBUG - jmeter.testelement.property.AbstractProperty:
> Running version, executing function
> 2011/09/24 21:30:47 INFO  - jmeter.engine.StandardJMeterEngine: Starting 0
> threads for group Thread Group.
> ...
>
> "Starting 0 threads...". I'm not sure is this a bug or is it related to the
> process how JMeter initializes the test (threads)?
>
>
> Nermin
>
>
>
>
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shet...@gmail.com]
> Sent: 24. septembar 2011 20:25
> To: JMeter Users List
> Subject: Re: Generate requests at specified time
>
> you can delay requests within a thread by using some of the timers (for
> e.g.
> Constant Timer - where the input is a variable calculated as the time you
> want to delay - the time the last sample took).
> However since you also have multiple requests at the same time - thats not
> easy to do (unless these urls are part of the same page in which case it
> might be possible to use the 2.5 feature of retrieving embedded requests)
> Plus you have additional problems of what happens if the first request
> takes
> more than one second? Is the next request still made?
>
> But like Oliver mentioned you seem to have this as a solution for a problem
> , and perhaps it may be more useful to describe what you want to do - maybe
> there are other options
>
> regards
> deepak
>
> On Sat, Sep 24, 2011 at 5:16 AM, Jian-Ming Zheng <jmzh...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Thanks for the reply.
> >
> > I have used the Constant Throughput Timer to control the number of
> > requests generated per minute. However, the function does not meet my
> > need. Let me explain it in more detail :)
> >
> > For example, I have 10 requests for the testing Web server (i.e.,
> > requests 1, 2, ., 10). I want to generate the 10 requests as follows.
> > [time] [requests]
> > 1 s: requests 1 and 2
> > 2 s: request 3
> > 3 s: request 4
> > 4 s: requests 5, 6, and 7
> > 5 s: request 8
> > 6 s: requests 9 and 10
> >
> > The number of requests generated per time interval is not constant. To
> > control the sequence of requests, I would like to generate a trace
> > file consisting of requests with the specified times. Can JMeter read
> > the file and generate requests at specified times according to the
> > trace?
> >
> > Thanks for any replies.
> >
> > On Sat, Sep 24, 2011 at 6:58 PM, Oliver Lloyd <oliver_ll...@hotmail.com>
> > wrote:
> > > Are you talking about pacing these requests? If so, try the
> > >
> >
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Constan
> t_Throughput_Timer
> > > Constant Throughput Timer .
> > >
> > > -----
> > > http://www.http503.com/
> > > --
> > > View this message in context:
> >
>
> http://jmeter.512774.n5.nabble.com/Generate-requests-at-specified-time-tp483
> 6359p4836368.html
> > > Sent from the JMeter - User mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Best Regards,
> > Zheng Jian-Ming a.k.a. zjm
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
>
>

Reply via email to