[erlang-questions] right tool for the job?

Nicolas Niclausse <>
Fri Oct 14 00:11:07 CEST 2011


Andy Kriger ecrivait le 12/10/2011 15:40:
> (I originally posted this to the Tsung mailing list but received no
> response so I'm broadening my request there to see if anyone with
> Tsung or Common Test experience might have an opinion on the matter)

I can't find your mail in the archive.

> I have a complex JMeter script that reads in a CSV where each row
> defines parameters to a test that makes an HTTP request as well as the
> expectations on the response. The JMeter script has logic to perform
> the correct assertions based on the incoming parameters. In short, it
> is not so much a load test as a way of doing many many permutations of
> HTTP requests (though as a side-effect it does put load on the server
> because there are so many permutations being run).
> I'm curious if Tsung allows for this kind of reading in data sets and
> performing logic based on the data to execute assertions or if it is
> intended for load testing only.  Can you extend Tsung with custom
> Erlang to accomplish more than just load testing?

I think you can do this in tsung. For example, if you have a csv with 2 
columns, url + expected response, you can:


<?xml version="1.0"?>
<tsung dumptraffic="protocol">

...

<options>
   <option name="file_server" id="urls" value="urls.csv" ></option>
</options>

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

  <repeat name="myloop" >
    <setdynvars sourcetype="file" fileid="urls" delimiter=";" order="iter">
      <var name="url" />
      <var name="response" />
    </setdynvars>

   <if var="myurl" neq="end">
    <request subst="true">
       <match do="log" when="nomatch" subst='true'>%%_response%%</match>
       <http url="%%_url%%" version='1.1' method='GET' />
     </request>
   </if>

  <!--  the last line of the file should be "end"-->
  <until var="url" eq="end"/> </repeat>
</session>

you can also include erlang code inside the tsung configuration file, see 
for example:
http://lists.process-one.net/pipermail/tsung-users/2011-October/001797.html

-- 
Nicolas



More information about the erlang-questions mailing list