[Tsung] Calling a %%module:function%% multiple times with same Pid

Stein, Martin martin.stein at sap.com
Wed May 21 01:08:42 CEST 2008


Hello Pablo,

That is pure genius! That will solve many problems. I have in the
meantime figured out that instead of using ETS tables, I can use the
process dictionary (put/get/erase) and things work then too. For some
reason the Pid changes from call to call sometimes ( <0.72.0> becomes
<6618.72.0> ) in the same session.

Many thanks!

-----Original Message-----
From: Pablo Polvorin [mailto:ppolv at yahoo.com.ar] 
Sent: Tuesday, May 20, 2008 16:01
To: Stein, Martin; tsung-users at process-one.net
Subject: Re: [Tsung] Calling a %%module:function%% multiple times with
same Pid

Hi Martin,

>>A workaround would be to allow putting the result
>>of a %%module:function%% call into a dynamic
>>variable, that could then be used to refer to the
>>same data later

there is a new feature available in svn trunk that let
you do exactly that. I think it isn't documented yet,
but take a look at
http://svn.process-one.net/tsung/trunk/examples/http_setdynvars.xml.in
for some sample usage.

Basically, all you need to do is add a setdynvar
element to your session:
<setdynvars sourcetype="random_number" start="3"
end="32">
     <var name="rndint" />
</setdynvars> 
That defines a variable named rndint, that can be used
as many times as you need (in that session).

<request subst="true"><http>...%%_rndint%%...
<request subst="true"><http>...%%_rndint%%...
   
(look at the samples, there are other source types
availables other than random_number, including erlang
callbacks)

cheers,
pablo



More information about the Tsung-users mailing list