You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Richard Gaywood <ri...@gmail.com> on 2005/11/08 13:01:18 UTC

Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Hi List! Let me start off with the obligitary gushing: JMeter really is a
nifty piece of work, and one I hope to be able to contribute code to soon.

Now, I've had to put together quite a complex test plan for our servers in a
bit of a rush, having never heard of JMeter until last week, and I'm a bit
concerned that some of the things I've done are not as good as they could
be. So if an experienced JMeter user or two would like to advise, I'd be
very greatful.

Firstly, I have three ThreadGroups in the whole test plan (each with it's
own JDBC request and CVS config file) and I want to be able to schedule the
test for a pre-set start time. Can I add all my main ThreadGroups under a
single master ThreadGroup (with just one thread), turn off scheduling on the
child ThreadGroups, then turn on scheduling on the master thread? This would
be a lot easier than configuring each ThreadGroup individually. I gave it a
go though and it didn't seem to work! Did I miss something?

Secondly, I've figured out how to log all the response times and whatnot to
an XML file when doing non-GUI testing, and figured out how to reload them
into JMeter to show the handy-dandy graphs but when I do that the throughput
doesn't get calculated properly. Is there anyway to get the measured
throughput out of a non-GUI test? That would speed my results collation. I'm
sure I can do it by crunching the XML file's response times but I don't want
to if I don't have to!

Thirdly, I want to run my master test plan four times: once with a small
number of threads and once with a large number *before* my server's admin
jobs run at 4AM, and then the small and large number of threads again after
4AM. I did this last night as four instances of the JMeter GUI with four
scheduled times, but that's rather tedious (and loading four separate GUIs
was rather hard on the load test server too). I see I can script the number
of threads (and presumably) the start times on the command line with a -J
option, but I still need to control the output file names for the XML file
to store the results. Can I control that over a -J option too? When I tried
setting it as a user parameter and setting the Filename in the
SimpleDataWriter as, for example, ${output.dir}/results1.xml it didn't work.
Is that because I can't mix-and-match ${} settings and plain text settings
in the same dialog box?

Fourthly, I can't find an option to log the number of bytes received in the
response; this would be a good sanity check for me that the data coming back
from the server isn't broken (as I'm doing JDBC and therefore don't have a
HTTP status code). Did I miss one or has this not been implemeted yet?

Any help with any of these would be greatfully received. Thanks in advance!

Regards,

Richard

Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by sebb <se...@gmail.com>.
On 08/11/05, Richard Gaywood <ri...@gmail.com> wrote:
> On 11/8/05, sebb <se...@gmail.com> wrote:
> >
> > On 08/11/05, Richard Gaywood <ri...@gmail.com> wrote:
> > > Firstly, I have three ThreadGroups in the whole test plan (each with
> > it's
> > > own JDBC request and CVS config file)
> >
> > Why do you need 3 Thread Groups?
>
>
> 3 different types of search being carried out on the system during the load
> test, abot 30% type1, 65% type2, 5% type3. I couldn't see any way to do that
> except to create three Thread Groups and set the number of threads in each
> appropriately.

One way to do this would be to use a Switch Controller with a Simple
Controller for each option.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Switch_Controller

Create the switch value using a function that returns 0, 1 or 2 in the
approriate proportions. This could be done with JavaScript or
BeanShell, or you could create a file with the numbers and read them
using CSV Data Set, StringFromFile or CSVRead.

If the search types can use the same Sampler with different
parameters, then create parameter files with an appropriate mix of
parameters and use those to drive the samples.

> > Fourthly, I can't find an option to log the number of bytes received in
> > the
> > > response; this would be a good sanity check for me that the data coming
> > back
> > > from the server isn't broken (as I'm doing JDBC and therefore don't have
> > a
> > > HTTP status code). Did I miss one or has this not been implemeted yet?
> >
> > Not yet implemented.
>
> OK, if I were to write something like that, would you be interested in the
> contribution back into the codebase? I'd have to run it by my employer first
> though. Also, do you currently offer response size logging for any other
> Sampler type? I guess not, but that would (presumably) cut down on the work
> I would have to do.

Contributions are welcome; please provide these via Bugzilla.

Response size logging is not provided for any Sampler type at present.
It should be easy enough to provide this. Please raise a Bugzilla
enhancement request.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by Richard Gaywood <ri...@gmail.com>.
On 11/8/05, sebb <se...@gmail.com> wrote:
>
> On 08/11/05, Richard Gaywood <ri...@gmail.com> wrote:
> > Firstly, I have three ThreadGroups in the whole test plan (each with
> it's
> > own JDBC request and CVS config file)
>
> Why do you need 3 Thread Groups?


3 different types of search being carried out on the system during the load
test, abot 30% type1, 65% type2, 5% type3. I couldn't see any way to do that
except to create three Thread Groups and set the number of threads in each
appropriately.

> Secondly, I've figured out how to log all the response times and whatnot
> to
> > an XML file when doing non-GUI testing, and figured out how to reload
> them
> > into JMeter to show the handy-dandy graphs but when I do that the
> throughput
> > doesn't get calculated properly. Is there anyway to get the measured
> > throughput out of a non-GUI test? That would speed my results collation.
> I'm
> > sure I can do it by crunching the XML file's response times but I don't
> want
> > to if I don't have to!
>
> The Summariser (see jmeter.properties) may help here.


Thanks, I will investigate that.

> Thirdly, I want to run my master test plan four times: once with a small
> > number of threads and once with a large number *before* my server's
> admin
> > jobs run at 4AM, and then the small and large number of threads again
> after
> > 4AM. I did this last night as four instances of the JMeter GUI with four
> > scheduled times, but that's rather tedious (and loading four separate
> GUIs
> > was rather hard on the load test server too). I see I can script the
> number
> > of threads (and presumably) the start times on the command line with a
> -J
> > option, but I still need to control the output file names for the XML
> file
> > to store the results. Can I control that over a -J option too? When I
> tried
> > setting it as a user parameter and setting the Filename in the
> > SimpleDataWriter as, for example, ${output.dir}/results1.xml it didn't
> work.
> > Is that because I can't mix-and-match ${} settings and plain text
> settings
> > in the same dialog box?
>
> No, it's because the Listeners create the file before the test has
> started; variables are not resolved then.


Aha, OK, that makes sense.

However, when running in batch (non-GUI), just use the -l command-line flag.
> You can define the result file contents using jmeter.properties.
>
> If you have some fixed and some variable properties, you can use a
> secondary property file (-q flag, I think).


I got around this by using -J on the command line and ${__P(foo)} in the
SimpleDataWriter filename field, but thanks for the suggestion, I'll keep
that in mind in the future.

> Fourthly, I can't find an option to log the number of bytes received in
> the
> > response; this would be a good sanity check for me that the data coming
> back
> > from the server isn't broken (as I'm doing JDBC and therefore don't have
> a
> > HTTP status code). Did I miss one or has this not been implemeted yet?
>
> Not yet implemented.


OK, if I were to write something like that, would you be interested in the
contribution back into the codebase? I'd have to run it by my employer first
though. Also, do you currently offer response size logging for any other
Sampler type? I guess not, but that would (presumably) cut down on the work
I would have to do.
Thanks for your time in writing this response.

Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by sebb <se...@gmail.com>.
On 08/11/05, Richard Gaywood <ri...@gmail.com> wrote:
> Hi List! Let me start off with the obligitary gushing: JMeter really is a
> nifty piece of work, and one I hope to be able to contribute code to soon.
>
> Now, I've had to put together quite a complex test plan for our servers in a
> bit of a rush, having never heard of JMeter until last week, and I'm a bit
> concerned that some of the things I've done are not as good as they could
> be. So if an experienced JMeter user or two would like to advise, I'd be
> very greatful.
>
> Firstly, I have three ThreadGroups in the whole test plan (each with it's
> own JDBC request and CVS config file) and I want to be able to schedule the
> test for a pre-set start time. Can I add all my main ThreadGroups under a
> single master ThreadGroup (with just one thread), turn off scheduling on the
> child ThreadGroups, then turn on scheduling on the master thread? This would
> be a lot easier than configuring each ThreadGroup individually. I gave it a
> go though and it didn't seem to work! Did I miss something?

Why do you need 3 Thread Groups?

> Secondly, I've figured out how to log all the response times and whatnot to
> an XML file when doing non-GUI testing, and figured out how to reload them
> into JMeter to show the handy-dandy graphs but when I do that the throughput
> doesn't get calculated properly. Is there anyway to get the measured
> throughput out of a non-GUI test? That would speed my results collation. I'm
> sure I can do it by crunching the XML file's response times but I don't want
> to if I don't have to!

The Summariser (see jmeter.properties) may help here.

> Thirdly, I want to run my master test plan four times: once with a small
> number of threads and once with a large number *before* my server's admin
> jobs run at 4AM, and then the small and large number of threads again after
> 4AM. I did this last night as four instances of the JMeter GUI with four
> scheduled times, but that's rather tedious (and loading four separate GUIs
> was rather hard on the load test server too). I see I can script the number
> of threads (and presumably) the start times on the command line with a -J
> option, but I still need to control the output file names for the XML file
> to store the results. Can I control that over a -J option too? When I tried
> setting it as a user parameter and setting the Filename in the
> SimpleDataWriter as, for example, ${output.dir}/results1.xml it didn't work.
> Is that because I can't mix-and-match ${} settings and plain text settings
> in the same dialog box?

No, it's because the Listeners create the file before the test has
started; variables are not resolved then.

However, when running in batch (non-GUI), just use the -l command-line flag.
You can define the result file contents using jmeter.properties.

If you have some fixed and some variable properties, you can use a
secondary property file (-q flag, I think).

> Fourthly, I can't find an option to log the number of bytes received in the
> response; this would be a good sanity check for me that the data coming back
> from the server isn't broken (as I'm doing JDBC and therefore don't have a
> HTTP status code). Did I miss one or has this not been implemeted yet?

Not yet implemented.

> Any help with any of these would be greatfully received. Thanks in advance!
>
> Regards,
>
> Richard
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by Richard Gaywood <ri...@gmail.com>.
On 11/8/05, sebb <se...@gmail.com> wrote:
>
> > However, whenever I load a JTX file using 2.1.1 I get a "Error loading
> > results file" message; in jmeter.log, I see
> >
> > 2005/11/08 13:14:11 WARN - jmeter.reporters.ResultCollector: File load
> > failure, trying old data format.
> >
> > Because of this error, the TOTAL line in the Aggregate Report doesn't
> work.
> > I've eyeballed the JTX file and it looks OK to me. I wouldn't need the
> TOTAL
> > line if I could figure out how to calculate the overall throughput
> myself...
> > but I can't, nor can I find it in the source. So: can anyone tell me how
> > throughput is calculated by the Aggregate Report tool?
> >
>
> Not sure what a JTX file is.


Uhh, that's my mistake, I mean JTL. Other than that, the error is as
reported; loading a JTL into my copy of JMeter gives me the message I
mention above.

If this does not fix the problem, create a Bugzilla issue and then
> attach jmeter.log, jmeter.properties and the "JTX" file.


OK, I will probably do that tomorrow.

Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by sebb <se...@gmail.com>.
On 08/11/05, Richard Gaywood <ri...@gmail.com> wrote:
> On 11/8/05, Richard Gaywood <ri...@gmail.com> wrote:
> >
> > Thirdly, I want to run my master test plan four times: once with a small
> > number of threads and once with a large number *before* my server's admin
> > jobs run at 4AM, and then the small and large number of threads again after
> > 4AM. I did this last night as four instances of the JMeter GUI with four
> > scheduled times, but that's rather tedious (and loading four separate GUIs
> > was rather hard on the load test server too). I see I can script the number
> > of threads (and presumably) the start times on the command line with a -J
> > option, but I still need to control the output file names for the XML file
> > to store the results. Can I control that over a -J option too? When I tried
> > setting it as a user parameter and setting the Filename in the
> > SimpleDataWriter as, for example, ${output.dir}/results1.xml it didn't
> > work. Is that because I can't mix-and-match ${} settings and plain text
> > settings in the same dialog box?
>
>
>
> OK, I'm partway along with this; I've written some batch files to run the
> test and output to various JTX files, and I've figured out that I can load
> them into the Aggregate Report component to get a nice breakdown. The
> throughput that gives me, though, doesn't tally with the throughput I get
> from the graph component (which is OK, I understand that this is probably
> because it's an average across all the run, whereas the graph component only
> gives me the last instantaneous value).
>
> However, whenever I load a JTX file using 2.1.1 I get a "Error loading
> results file" message; in jmeter.log, I see
>
> 2005/11/08 13:14:11 WARN - jmeter.reporters.ResultCollector: File load
> failure, trying old data format.
>
> Because of this error, the TOTAL line in the Aggregate Report doesn't work.
> I've eyeballed the JTX file and it looks OK to me. I wouldn't need the TOTAL
> line if I could figure out how to calculate the overall throughput myself...
> but I can't, nor can I find it in the source. So: can anyone tell me how
> throughput is calculated by the Aggregate Report tool?
>

Not sure what a JTX file is.

JMX files are test scripts and are loaded by File/open or on the command line.

JTL files are test logs, and can be loaded in a Listener

If this does not fix the problem, create a Bugzilla issue and then
attach jmeter.log, jmeter.properties and the "JTX" file.

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by Richard Gaywood <ri...@gmail.com>.
On 11/8/05, Richard Gaywood <ri...@gmail.com> wrote:
>
> Thirdly, I want to run my master test plan four times: once with a small
> number of threads and once with a large number *before* my server's admin
> jobs run at 4AM, and then the small and large number of threads again after
> 4AM. I did this last night as four instances of the JMeter GUI with four
> scheduled times, but that's rather tedious (and loading four separate GUIs
> was rather hard on the load test server too). I see I can script the number
> of threads (and presumably) the start times on the command line with a -J
> option, but I still need to control the output file names for the XML file
> to store the results. Can I control that over a -J option too? When I tried
> setting it as a user parameter and setting the Filename in the
> SimpleDataWriter as, for example, ${output.dir}/results1.xml it didn't
> work. Is that because I can't mix-and-match ${} settings and plain text
> settings in the same dialog box?



OK, I'm partway along with this; I've written some batch files to run the
test and output to various JTX files, and I've figured out that I can load
them into the Aggregate Report component to get a nice breakdown. The
throughput that gives me, though, doesn't tally with the throughput I get
from the graph component (which is OK, I understand that this is probably
because it's an average across all the run, whereas the graph component only
gives me the last instantaneous value).

However, whenever I load a JTX file using 2.1.1 I get a "Error loading
results file" message; in jmeter.log, I see

2005/11/08 13:14:11 WARN - jmeter.reporters.ResultCollector: File load
failure, trying old data format.

Because of this error, the TOTAL line in the Aggregate Report doesn't work.
I've eyeballed the JTX file and it looks OK to me. I wouldn't need the TOTAL
line if I could figure out how to calculate the overall throughput myself...
but I can't, nor can I find it in the source. So: can anyone tell me how
throughput is calculated by the Aggregate Report tool?

Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by Richard Gaywood <ri...@gmail.com>.
On 11/8/05, Noam Paz <no...@db.com> wrote:
>
> Hi Richard,



Hi Noam! Thanks for the reply.

>>>
> Fourthly, I can't find an option to log the number of bytes received in
> the
> response; this would be a good sanity check for me that the data coming
> back
> from the server isn't broken (as I'm doing JDBC and therefore don't have a
> HTTP status code). Did I miss one or has this not been implemeted yet?
> <<<
> You'd probably like to use the size assertion.



I looked at that, but the search sizes I'm getting back vary by the query I
enter into the DB (which in turn is controlled by a 10,000 line CSV file
with different searches). This is to work over different caches and internal
data structures. I could set an assertion that size must always be greater
than $SOME_SMALL_AMOUNT, but something else I'd like to do in my final
report is "I issed 5000 requests to the DB and the average response size was
400Kb" which I can't do with an assertion.

Re: Advice needed: multiple ThreadGroups, scheduling, running a test multiple times

Posted by Noam Paz <no...@db.com>.




Hi Richard,
>>>
Fourthly, I can't find an option to log the number of bytes received in the
response; this would be a good sanity check for me that the data coming back
from the server isn't broken (as I'm doing JDBC and therefore don't have a
HTTP status code). Did I miss one or has this not been implemeted yet?
<<<
You'd probably like to use the size assertion.

Best regards

Noam Paz





--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org