You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jonathan Mew <jo...@thetestpeople.com> on 2015/10/05 14:18:06 UTC

Plugin to automatically transfer resource files (csvs) from controller to injectors

Hi,

When carrying out performance load testing on JMeter, we often set up a
controller and multiple injectors and use CSV files as data sources. We
then have to manually copy each CSV file to each injector. In cases where
we don't want the same data being used by multiple injectors we also have
to split the csv up into separate files, copy each file to a different
injector etc. It feels like something that we should automate to save time
and avoid human error.

Requirements:
- Automate copying csv files from controller to injects before testing
begins
- No test should begin until all csvs have been copied (to avoid lag for
later injectors)
- The file transfer should be automatically triggered when the test is
started (to avoid human error in forgetting to do it)
- It should be possible to split a CSV between injectors so that lines are
evenly shared.

So my question is: *Is it possible for me to do this purely by writing a
plugin? If so, what kinds of objects would I be looking at creating and
whereabouts in the code is/are the method call(s) into it that I'd be
using?*

Looking at the code in DistributedRunner.start() and
ClientJMeterEngine.runTest(), I can't see any hooks I could use to execute
plugin code after starting the test run but before running other steps.
Unfortunately, using the HashTreeTraversers in ClientJMeterEngine.runTest()
would result in files being transferred on one Injector after testing had
started on another injector, potentially introducing lag between tests.

Any help much appreciated and if this is not currently possible I'll give
the dev list a try!

Many thanks,

Jonathan Mew

-- 
*Before acting on this email or opening any attachments please read the 
important notice at the end of this email.*

Passionate about Testing, Excited by Technology


------------------------------
This communication is strictly confidential and intended solely for the 
person to whom it is addressed, and it may be legally privileged. If you 
are not the intended recipient or have received this communication in 
error, please do not read it or show it to any other person, but notify us 
immediately and then delete it from your computer. Any unauthorised 
disclosure of information contained in this communication is strictly 
prohibited.
 
The Test People Limited.  Registered in England and Wales Number 6326413
Registered Office - Albion Court, 5 Albion Place, Leeds, LS1 6JL - 0113 320 
4801
London Office - Portland House, Bressenden Place, London, SW1E 5RS - 020 
7100 7794

Re: Plugin to automatically transfer resource files (csvs) from controller to injectors

Posted by Jonathan Mew <jo...@thetestpeople.com>.
Hi Sergio,

Thanks for such a prompt response.

On 5 October 2015 at 14:14, Sergio Boso <se...@bosoconsulting.it> wrote:
>>> Hi
>>> I had same issue, but solved differently by using a central Db with
Redis.
>>> I think it is much better approach, more flexible and scalable.
>>> This can support either circular lists ( e.g. user info) and
use-only-once data.

>>> You can use the plugin from Jmeter - plugin ( not so complete anyway)
or develop your own integration, which is quite simple any way.

I haven't used Redis before, so I've had a look at some basic documentation
and I don't think that this would solve my problem.

Plus points:
- Redis would allow access to the data over a network and that would
certainly allow multiple injectors to access the data whilst just
maintaining a single copy.
- Redis looks quick, scalable and reliable. I don't think we ever use
resource files that would be too big to hold in memory.
- It also looks like it wouldn't be too much effort to load the data onto a
Redis server from a CSV (e.g.
http://blog.mostafazh.me/2015/07/21/fastest-way-to-import-big-csv-to-redis/
).

I'm not too sure about whether I could do something similar to load data on
Windows (it looks like a Redis port is available for Win64 though not
actively supported by Redis).

However, I'd rather not use this solution because:
 - This doesn't solve the problem of /automating/ the data loading at the
point of testing, as the tester will still need to remember to reload the
data into Redis any time the data set is updated. This is the main gain of
making this change in the first place (get rid of little things that are
laborious or easy to forget and might mean restarting the test part way
through).
 - As it stands, this plugin doesn't enable me to share the data out so
that data is reusable, but not used twice simultaneously. For this, the
data would need to be replaced in Redis after each use (I could perhaps
tweak the plugin or as you say, write a new one to achieve this though).

Still, nice idea and I can see it working in other circumstances.

Thanks again,

Jonathan

-- 
*Before acting on this email or opening any attachments please read the 
important notice at the end of this email.*

Passionate about Testing, Excited by Technology


------------------------------
This communication is strictly confidential and intended solely for the 
person to whom it is addressed, and it may be legally privileged. If you 
are not the intended recipient or have received this communication in 
error, please do not read it or show it to any other person, but notify us 
immediately and then delete it from your computer. Any unauthorised 
disclosure of information contained in this communication is strictly 
prohibited.
 
The Test People Limited.  Registered in England and Wales Number 6326413
Registered Office - Albion Court, 5 Albion Place, Leeds, LS1 6JL - 0113 320 
4801
London Office - Portland House, Bressenden Place, London, SW1E 5RS - 020 
7100 7794

Re: Plugin to automatically transfer resource files (csvs) from controller to injectors

Posted by Sergio Boso <se...@bosoconsulting.it>.
Hi
I had same issue, but solved differently by using a central Db with Redis.
I think it is much better approach, more flexible and scalable.
This can support either circular lists ( e.g. user info) and use-only-once
data.

You can use the plugin from Jmeter - plugin ( not so complete anyway) or
develop your own integration, which is quite simple any way.

Regards

Sergio Boso

Sergio Boso
cell. 335 7243 445
Hi,

When carrying out performance load testing on JMeter, we often set up a
controller and multiple injectors and use CSV files as data sources. We
then have to manually copy each CSV file to each injector. In cases where
we don't want the same data being used by multiple injectors we also have
to split the csv up into separate files, copy each file to a different
injector etc. It feels like something that we should automate to save time
and avoid human error.

Requirements:
- Automate copying csv files from controller to injects before testing
begins
- No test should begin until all csvs have been copied (to avoid lag for
later injectors)
- The file transfer should be automatically triggered when the test is
started (to avoid human error in forgetting to do it)
- It should be possible to split a CSV between injectors so that lines are
evenly shared.

So my question is: *Is it possible for me to do this purely by writing a
plugin? If so, what kinds of objects would I be looking at creating and
whereabouts in the code is/are the method call(s) into it that I'd be
using?*

Looking at the code in DistributedRunner.start() and
ClientJMeterEngine.runTest(), I can't see any hooks I could use to execute
plugin code after starting the test run but before running other steps.
Unfortunately, using the HashTreeTraversers in ClientJMeterEngine.runTest()
would result in files being transferred on one Injector after testing had
started on another injector, potentially introducing lag between tests.

Any help much appreciated and if this is not currently possible I'll give
the dev list a try!

Many thanks,

Jonathan Mew

--
*Before acting on this email or opening any attachments please read the
important notice at the end of this email.*

Passionate about Testing, Excited by Technology


------------------------------
This communication is strictly confidential and intended solely for the
person to whom it is addressed, and it may be legally privileged. If you
are not the intended recipient or have received this communication in
error, please do not read it or show it to any other person, but notify us
immediately and then delete it from your computer. Any unauthorised
disclosure of information contained in this communication is strictly
prohibited.

The Test People Limited.  Registered in England and Wales Number 6326413
Registered Office - Albion Court, 5 Albion Place, Leeds, LS1 6JL - 0113 320
4801
London Office - Portland House, Bressenden Place, London, SW1E 5RS - 020
7100 7794