[Tsung] looping [was:Re:backend and fullstats]

Nicolas Niclausse nicolas at niclux.org
Tue Apr 29 16:39:29 CEST 2008


Pablo Polvorin ecrivait le 29.04.2008 16:23:
> Hi,
> yesterday I posted a little patch in the bug tracker
> that implents both conditional and inconditional
> looping construct.
>> I think the problem, with an XML implementation, is
>> the condition for
>> repeating (ie finding a value in data received from
>> host) could be far from
>> the involved request:
> Agree with that. My approach was try to use a "repeat"
> syntax, and write the condition at the end of the
> loop:
> <repeat> 
>     ... 
>    <request> 
>    <dyn_variable name="result" regexp="Result:
> \(.*\)"/> 
>    <http url="/random" method="GET"
> version="1.1"></http> 
>   </request> 
>     ... 
>     <until var="result" eq="5"/> 
> </repeat> 
> 
> downside is that now you need two elements for
> conditional loop: repeat and until (repeat/while is
> implemented also). <until> or <while> should allways
> appear at the last element inside a <repeat/>
> construct
> 
> patch and additional comments in 
> https://support.process-one.net/browse/TSUN-62

Hello,

thanks for the patch !

It looks ok for me, I'll include it soon.

>> translating XML scenarios to
>> erlang language, compile the resulting code and
>> execute it inside the
>> controller ?
> don't know, to me it seems as really difficult, far,
> too far away from what a "little patch" could do :-) .
> Nicolas?

Yes, seems very complicated ... :/

What could be done i think,  in the case where you need to code a dynamic 
function:

Instead of creating an external file (compile and put in the erlang PATH): 
just add the code in the XML and compile it on the fly during the XML parsing.

Sounds useful for anyone ?

-- 
Nicolas


More information about the Tsung-users mailing list