[Tsung] Can I use file_server per-user with dynamically computed file name?

Nicolas Niclausse nicolas at niclux.org
Thu Oct 13 23:46:06 CEST 2011

Nicolas Niclausse ecrivait le 13/10/2011 17:02:

this one is ok (a bit ugly, but it works):

   <session name="http_csv" probability="100" type="ts_http">

<!--get an IP from the registry file -->
    <setdynvars sourcetype="file" fileid="registry" delimiter=";" order="iter">
         <var name="ipserver" />

<!--start a file server for this session using the IP -->

    <setdynvars sourcetype="eval" code="fun({Pid,DynVars})->
                            ts_file_server:read([{Id, IP ++ 
&quot;.txt&quot; }],10000)
         <var name="useless" />

  <repeat name="myloop" >

<!-- get the next line from our csv -->

    <setdynvars sourcetype="eval"
                            {ok, Val} = ts_file_server:get_next_line(Id),
         <var name="myurl" />
   <if var="myurl" neq="endmark">
    <request subst="true">
           <http url="%%_myurl%%" version='1.1' method='GET' />
  <!--  the last line of the file should be "endmark"-->
  <until var="myurl" eq="endmark"/> </repeat>


More information about the Tsung-users mailing list