On 9 September 2010 13:05, Jens Müller <jen...@hotmail.com> wrote:
>
> Hello,
>
> JMeter does not seem to include a test element that allows a string out of a 
> list to be assinged to a variable, guaranteeing at most once semantics for 
> all users, even in distributed mode. Meaning that every element of the list 
> will only be used once, even trhoughout multiple test runs.
>
> I have the following in mind:
> Creating a ConfigTestElement (currently a TestBean) which allows the user to 
> add a list of values. When starting the test, this list would be put into a 
> centrally accessible singleton and everytime a value would be read in 
> iterationStart, it would be removed from this central list and assigned to a 
> variable, similarly to CSV Data Set Config, only that the value is not read 
> from a file.
> So far possible.

But it will require large amounts of memory.

> When the test is completed, only the remaining unused values should be 
> present in the test element. How can I modify a specific element in the test 
> tree? If I implement TestListener and change the list in testEnded, this 
> change is not applied to the test element if I open it in the test plan. It 
> is probably cloned, but even by overriding clone and keeping a reference to 
> the original element, I cannot get the test element's values changes.
>
>
> Furthermore, in distributed mode, I would need to split the list in equal 
> parts to the different client hosts. This could be done somewhere in 
> ClientJMeterEngine#Configure, not cloning the element, but taking a sublist 
> of the complete list. The total number of hosts and the number of the current 
> host would need to be known for this. These two values could be filled into 
> some context in RemoteStart#doAction.
>
> Every host would then perform its test run and at the end, they would need to 
> send back the sublist of unused items. As far as I understand, only the 
> Listeners are wrapped with RemoteListenerWrapper so that they can transfer 
> back information. Maybe the information which elements of the list were not 
> used can be piggybacked somewhere on testEnded? The compund list of remaining 
> items would then again need to be incorporated into the original test element 
> - a problem I already described above.
>
>
> Any help in solving any of these sub tasks is very appreciated.

It will be complicated to do this as you describe it.

The StringFromFile function has a feature which allows it to read from
multiple files.

This was created to solve a problem whereby we could only use an
account number once in a test.
So we created lots of files, each with a different subset of the valid numbers.
For each test, we made a note of which files had been used, and
updated the start and end numbers accordingly.

One way to do this in distributed mode might be to enhance CSV DataSet.
- add a starting line number, so it would skip that number of lines
when opening the file.
- log the finishing line number; this can be used for determining the
next test starting value.
- for multiple remote servers, you could also add an increment value,
so it would only read every Nth record.

Start and end line numbers for CSV Dataset might be useful anyway, and
should be easy to add. Likewise increment.

However I'm not sure how you get each server to start with a different line.
Perhaps JMeter could set a special property to the server number when
starting multiple server tests.

One could just edit the properties on each server, but that would be tedious.

You could play around with reading a database table, and use the
hostname as the key to the CSV start/increment/ending variables.

> Jens
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: dev-h...@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: dev-h...@jakarta.apache.org

Reply via email to