1

I am using Tsung for load testing. Here is the config file for Tsung.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" []>
<tsung loglevel="warning">

  <clients>
    <client host="t1" cpu="2" maxusers="30000000"/>
    <client host="t2" cpu="2" maxusers="30000000"/>
  </clients>

  <servers>
    <server host="localhost" port="9200" type="tcp"/>
  </servers>

  <load>
    <arrivalphase phase="1" duration="1" unit="minute">
      <users arrivalrate="5" unit="second"/>
    </arrivalphase>
  </load>
</tsung>

But, I want the following:

  1. Only one user per client everytime
  2. Specific data to be read from file for each user. As in, I want to read data from a user1.json for user1 (on client 1) and from user2.json for user2 (on client2).

Is this possible in Tsung? I went through the docs, but didn't find any option to do so. Can someone help me out with this?

skjindal93
  • 706
  • 1
  • 16
  • 34

1 Answers1

0

Not exactly what you're asking for. But something similar is possible, with one input file.

<options>
  <option name="file_server" id="inputUsers" value="/tmp/users.txt"/>
</options>

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

    <setdynvars sourcetype="file" fileid="inputUsers" delimiter=";" order="iter">
      <var name="userId"/>
      <var name="deviceMac"/>
      <var name="tKey"/>
    </setdynvars>

    <request subst="true">
      <http url="/abc/%%_userId%%/%%_deviceMac%%?arg=%%_tKey%%" version="1.1"></http>
    </request>

    <request subst="true">
      <http url="/123/%%_userId%%" version="1.1"></http>
    </request>

  </session>
</sessions>

Where /tmp/users.txt contains colon separated user specific values - something like this (userId;deviceMac;tKey):

97099;05d4e99de98a;4xrwgyyze54kefnwsd74kj4ghvn5f1

Considering the setdynvars order value is "iter", it will iterate through each line, and use that input data as request parameters. In the above example case, it would make these two requests:

/abc/97099/05d4e99de98a?arg=4xrwgyyze54kefnwsd74kj4ghvn5f1
/123/97099

You can achieve "user specific" load test scenario this way.

diarpi
  • 86
  • 7