You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jan <ja...@gmail.com> on 2012/05/28 11:28:54 UTC

Resource pool initialisation and garbage collection

I have a requirement to use a resource pool to provide each Sampler instance
with a resource to be used during the call to sample(Entry e).  

When the resource pool is initiated and performs a few one-off actions and 
then supplies pool objects based on its configuration.  

I don't want to keep initiating the one-off actions performed by the pool, 
as then they are no longer one-off actions, plus I wouldn't be testing just 
the action performed on the pool object but the set up of the dependent 
resources.

This resource pool instance tidies up after itself when is goes out of 
scope, however it never seems goes out of scope unless I tidy up in the
sample(Entry e) of the Sampler, but as stated above, that would mean 
recreating the pool each sample call and then tidying it up.

Creating the sampler was relatively straight forward, but I can't see 
how to initialise a test run specific reference and tidy up after I'm 
done with the test run.

I had a look at the SetupThreadGroup, but it's not really what I need.  

Any help would be frustration relieving (-;




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


Re: Resource pool initialisation and garbage collection

Posted by Jan <ja...@gmail.com>.
testStarted testEnded are indeed what I needed after all.





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


Re: Resource pool initialisation and garbage collection

Posted by sebb <se...@gmail.com>.
On 28 May 2012 11:32, Jan <ja...@gmail.com> wrote:
>> Have a look at the TestListener interface methods.
> Isn't the TestListener interface implemented at the test level
> rather than the test run level?

Not sure what you mean.

Try it and see - add a log statement to check if it meets your requirements.

>> Also look at JDBC Config, which I think has similar requirements.
> Thanks.  This looks extremely convoluted to enable scoping to a test run
> rather than to a single test within a run.

Again I don't know what you mean here.

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


Re: Resource pool initialisation and garbage collection

Posted by Jan <ja...@gmail.com>.
> Have a look at the TestListener interface methods.
Isn't the TestListener interface implemented at the test level 
rather than the test run level?

> Also look at JDBC Config, which I think has similar requirements.
Thanks.  This looks extremely convoluted to enable scoping to a test run 
rather than to a single test within a run.








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


Re: Resource pool initialisation and garbage collection

Posted by sebb <se...@gmail.com>.
On 28 May 2012 10:28, Jan <ja...@gmail.com> wrote:
> I have a requirement to use a resource pool to provide each Sampler instance
> with a resource to be used during the call to sample(Entry e).
>
> When the resource pool is initiated and performs a few one-off actions and
> then supplies pool objects based on its configuration.
>
> I don't want to keep initiating the one-off actions performed by the pool,
> as then they are no longer one-off actions, plus I wouldn't be testing just
> the action performed on the pool object but the set up of the dependent
> resources.
>
> This resource pool instance tidies up after itself when is goes out of
> scope, however it never seems goes out of scope unless I tidy up in the
> sample(Entry e) of the Sampler, but as stated above, that would mean
> recreating the pool each sample call and then tidying it up.
>
> Creating the sampler was relatively straight forward, but I can't see
> how to initialise a test run specific reference and tidy up after I'm
> done with the test run.
>
> I had a look at the SetupThreadGroup, but it's not really what I need.
>

Have a look at the TestListener interface methods.

Also look at JDBC Config, which I think has similar requirements.

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