jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Alternative to the static modifier in BeanShell
Date Tue, 13 Dec 2011 15:17:45 GMT
On 13 December 2011 15:03, aidy lewis <aidy.lewis@gmail.com> wrote:
> Hi Sebb,
>
> Thanks for your response.
>
> I am able to use a user defined variable in a BeanShell post-processor?

See:

http://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PostProcessor

> UDV
> name: count
> value: 0
>
> BeanShell post-processor
> print(vars.get("count");
>
> Thanks
>
> Aidy
>
>
>
>
>
> On 13 December 2011 14:27, sebb <sebbaz@gmail.com> wrote:
>> On 13 December 2011 13:57, aidy lewis <aidy.lewis@gmail.com> wrote:
>>> Hi,
>>>
>>> Without a static modifier in BeanShell, how can I prevent the below
>>> ArrayList from being re-initialised  during each thread?
>>
>> Use the init file to define the variable.
>>
>> Or store the list in a JMeter variable which you create if missing.
>>
>>> """
>>>
>>> headerList = new ArrayList();
>>>
>>> countCacheMisses() {
>>>  print("counting cache misses");
>>>  if (vars.get("HEADER") =="MISS");
>>>    headerList.add("MISS");
>>>    print("the size of the array");
>>>    print(headerList.size());
>>> }
>>>
>>>
>>> countCacheMisses()
>>>
>>> """
>>>
>>> Aidy Lewis
>>> Test Discipline Lead (News and Knowledge)
>>> m: +44 (0) 7539655835
>>> w: +44 (0) 208 008 4584
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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


Mime
View raw message