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

Pablo Polvorin ppolv at yahoo.com.ar
Tue Apr 29 16:23:55 CEST 2008


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

> 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?
  
 

--- philippe vanderstraeten <phvander at gmail.com>
escribió:

> Hello
> 
> I also want to add something about looping. Having a
> <repeat> for
> transaction or request is something very usefull.
> And this <repeat> tag need
> also be conditional and unconditional.
> 
> 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:
> 
> <repeat condition="a string found">
> <transaction>
> <request1>
> <request2>
> <request3>
> </transaction>
> </repeat>
> 
> If the condition refers request 3 perhaps it will be
> complex to maintain a
> context during the whole repeat....and it could
> implies big changes inside
> the controller implementation
> 
> I used for 2 years another tool and the scripting
> language was C and C
> macros. Is it possible to evaluate the cost of
> translating XML scenarios to
> erlang language, compile the resulting code and
> execute it inside the
> controller ?
> 
> Excuse me if what I wrote is too complex. Sometimes
> thinking to stupid
> things may be usefull.
> 
> 
> On Mon, Apr 21, 2008 at 6:57 PM, Pablo Polvorin
> <ppolv at yahoo.com.ar> wrote:
> 
> > Hi Nicolas,
> > would you consider it usefull to implement this
> > in a more "structured programming" way?.
> >
> > I mean, instead of the goto-like 'loop_back',
> > introduce a new element, ("repeat" or "for" , i
> don't
> > know).
> > The previous scenario could be something like
> this:
> >
> > <repeat>
> >  <transaction>
> >     ...
> >  <transaction/>
> >   ...
> >  <request>
> >  <dyn_variable name="SomeVar"
> >                    regexp="exp"/>
> >   <http url='/myapp/Calibrage?pagelen=8192'
> > version='1.1' method='GET'></http>
> >  </request>
> >   <while var="SomeVar" match="regx"/>
> > </repeat>
> >
> > implementation doesn't seems to be too different
> from
> > the loop-back one (if "SomeVar" match in the while
> > element, then jump to the previous repeat).
> Indeed,
> > perhaps if we keep a stack of the repeat elements
> > while parsing, we could even allow nested cycles.
> >
> > If we want a fixed number of repetitions:
> > <repeat times="100">
> > ...
> > </repeat>
> >
> > I know... the scenario description language is
> getting
> > more and more complex...
> > but it's a kind of scripting language anyway, and
> I
> > guess than for most users, put a set of
> > request/transaction inside a <repeat> element
> would be
> > more natural than use a loop-back IMHO.
> >
> > By the way, I volunteer to do this work if you
> agree.
> >
> > cheers!
> >
> >
> >
> > --- Nicolas Niclausse <nicolas at niclux.org>
> escribió:
> >
> > > philippe vanderstraeten ecrivait le 21.04.2008
> > > 16:30:
> > > > Nicolas,
> > > >
> > > > Thanks for your anwser. Following is my
> scenario
> > > file (web site and
> > > > application names have been replaced with
> > > anonymous names).
> > >
> > > OK, I see. The problems comes from the new
> > > 'loop_back' feature.
> > >
> > > Each beginning and ending tag of a transaction
> must
> > > be added in the
> > > loop_back calculation.
> > >
> > > In your case, if you want to loop back to the
> > > beginning of 'trx_dummy1',
> > > you must set: loop_back=7
> > >
> > > That's ugly :)
> > >
> > > I think i'll have to add an 'id' attribute to
> > > 'request' and 'transaction'
> > > and use this 'id' in loop_back instead of a
> counter.
> > > This will be more user
> > > friendly.
> > >
> > > --
> > > Nicolas
> > > _______________________________________________
> > > Tsung-users mailing list
> > > Tsung-users at lists.process-one.net
> > >
> >
>
https://lists.process-one.net/mailman/listinfo/tsung-users
> > >
> >
> >
> >
> >       Yahoo! Encuentros.
> >
> > Ahora encontrar pareja es mucho más fácil, probá
> el nuevo Yahoo!
> > Encuentros
>
http://yahoo.cupidovirtual.com/servlet/NewRegistration
> > _______________________________________________
> > Tsung-users mailing list
> > Tsung-users at lists.process-one.net
> >
>
https://lists.process-one.net/mailman/listinfo/tsung-users
> >
> 



      Los referentes más importantes en compra/ venta de autos se juntaron:
Demotores y Yahoo!
Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/


More information about the Tsung-users mailing list