tsung

Whats the relation between load and for?


I am trying tsung for the first time, however, I need some clarification.

I am using load tag as:

<load>
    <arrivalphase phase="1" duration="1" unit="minute">
        <users maxnumber="100000" interarrival="0.01" unit="second"/>
    </arrivalphase>
</load>

But, how would the for loop below works ?:

 <sessions>
<session name="root" probability="100" type="ts_http">
   <for from="1" to="2" var="i">

       <request>
           <http url="/test/counter" method="POST" contents="bla=blu&amp;name=glop">
           </http>
       </request>

   </for>
  </session>

What I thought is that the loop will count from 1 to 2, thus, sending only two requests, however, when I run the xml file, I got hundred of requests! Does this mean that each user in arrivalphase will send two requests as in the for loop above?

Can someone explain, what's the relation between the for tag and load tag as in the above example?


Solution

  • Your analysis is right , during the first 1 minute of the test , you created 100 users per second,each user will send two requests as in the for loop above。

    The load define tsung generate rules of the user, the session define every user needs to perform logic.