You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Alexander Wallace <aw...@rwmotloc.com> on 2007/01/09 20:46:25 UTC

intro and question about jdbc load tests

Hi all! New to the list here so please be patient ;)

I need to write a load test against a mysql database... I have  
obtained queries created by our application, i logged all queries  
generated by a regression test.

It would be fairly simple to write a small program to generate the  
xml that represents the test off of the cleaned up logs... One thing  
i want to find out is if something like this already exists or I  
should go ahead and write it...

If so, my idea was to simple create an xml file, but chances are  
there is an object (a test?) that i can instantiate and set stuff on  
it that would generate the xml for me?

Further more, should this be written in a way that can be used as a  
plugin in jmeter ? (i'll need more assistance here if this is a  
desirable thing).

Additionally... My load test will have 7k+ queries... which if i  
follow this path will end up in a test with 7k+ jdbc samplers... I  
bet that uses a lot of memory.... Is this adviseable?

How hard would it be to write a plugin that would simulate N jdbc  
samplers out of a file (1 qry per line)? It would be nice that it  
could use also a csv file to customize each sampler....

Thanks in advance for your response!


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


Re: intro and question about jdbc load tests

Posted by sebb <se...@gmail.com>.
On 09/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> Thanks a lot for the quick response!
>
> Please see below.
>
> >
> > Why not just use CSV Dataset to pass in the query details?
> >
> > The file can be as big as you like, and you can use the variables in
> > the JDBC sampler.
> >
> > The JDBC Sampler allows the Query Type to be a variable, so you can
> > even mix SELECTs and UPDATEs [for DELETE use UPDATE].
>
> This would mean that I have 1 jdbc sampler and each iteration changes
> the query for the sampler right? I gave this a bit of thought before
> sending the email, but how can I simulate multiple threads this way?
> And if each thread needs to vary a little bit of the query (say the
> CustomerId) how would this work?
>

Just use multiple threads - each thread will get the next line from the file.

To vary the SQL, use a variable to hold the varying part, and
reference it in the JDBC sampler using the normal ${VARNAME} syntax.
Remember to quote the variable if it is a string - see:

http://jakarta.apache.org/jmeter/usermanual/functions.html#Where

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


Re: intro and question about jdbc load tests

Posted by Alexander Wallace <aw...@rwmotloc.com>.
Thanks a lot for the quick response!

Please see below.

>
> Why not just use CSV Dataset to pass in the query details?
>
> The file can be as big as you like, and you can use the variables in
> the JDBC sampler.
>
> The JDBC Sampler allows the Query Type to be a variable, so you can
> even mix SELECTs and UPDATEs [for DELETE use UPDATE].

This would mean that I have 1 jdbc sampler and each iteration changes  
the query for the sampler right? I gave this a bit of thought before  
sending the email, but how can I simulate multiple threads this way?  
And if each thread needs to vary a little bit of the query (say the  
CustomerId) how would this work?

I'm not an expert in jmeter as you can see, please forgive the  
questions if they don't make much sense.

Thanks in advance again for your response!


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


Re: intro and question about jdbc load tests

Posted by Alexander Wallace <aw...@rwmotloc.com>.
Thanks a lot for pointing to me the right path!

On Jan 9, 2007, at 2:10 PM, sebb wrote:

> On 09/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
>> Hi all! New to the list here so please be patient ;)
>>
>> I need to write a load test against a mysql database... I have
>> obtained queries created by our application, i logged all queries
>> generated by a regression test.
>>
>> It would be fairly simple to write a small program to generate the
>> xml that represents the test off of the cleaned up logs... One thing
>> i want to find out is if something like this already exists or I
>> should go ahead and write it...
>
> There's nothing in JMeter.
>
> But see below.
>
>> If so, my idea was to simple create an xml file, but chances are
>> there is an object (a test?) that i can instantiate and set stuff on
>> it that would generate the xml for me?
>>
>> Further more, should this be written in a way that can be used as a
>> plugin in jmeter ? (i'll need more assistance here if this is a
>> desirable thing).
>>
>> Additionally... My load test will have 7k+ queries... which if i
>> follow this path will end up in a test with 7k+ jdbc samplers... I
>> bet that uses a lot of memory.... Is this adviseable?
>
> Not advisable - but see below.
>
>> How hard would it be to write a plugin that would simulate N jdbc
>> samplers out of a file (1 qry per line)? It would be nice that it
>> could use also a csv file to customize each sampler....
>
> Why not just use CSV Dataset to pass in the query details?
>
> The file can be as big as you like, and you can use the variables in
> the JDBC sampler.
>
> The JDBC Sampler allows the Query Type to be a variable, so you can
> even mix SELECTs and UPDATEs [for DELETE use UPDATE].
>
> I suggest you try and see how you get on with this before starting to
> write any XML.
>
> S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: intro and question about jdbc load tests

Posted by sebb <se...@gmail.com>.
On 09/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> Hi all! New to the list here so please be patient ;)
>
> I need to write a load test against a mysql database... I have
> obtained queries created by our application, i logged all queries
> generated by a regression test.
>
> It would be fairly simple to write a small program to generate the
> xml that represents the test off of the cleaned up logs... One thing
> i want to find out is if something like this already exists or I
> should go ahead and write it...

There's nothing in JMeter.

But see below.

> If so, my idea was to simple create an xml file, but chances are
> there is an object (a test?) that i can instantiate and set stuff on
> it that would generate the xml for me?
>
> Further more, should this be written in a way that can be used as a
> plugin in jmeter ? (i'll need more assistance here if this is a
> desirable thing).
>
> Additionally... My load test will have 7k+ queries... which if i
> follow this path will end up in a test with 7k+ jdbc samplers... I
> bet that uses a lot of memory.... Is this adviseable?

Not advisable - but see below.

> How hard would it be to write a plugin that would simulate N jdbc
> samplers out of a file (1 qry per line)? It would be nice that it
> could use also a csv file to customize each sampler....

Why not just use CSV Dataset to pass in the query details?

The file can be as big as you like, and you can use the variables in
the JDBC sampler.

The JDBC Sampler allows the Query Type to be a variable, so you can
even mix SELECTs and UPDATEs [for DELETE use UPDATE].

I suggest you try and see how you get on with this before starting to
write any XML.

S.

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