Introduction


The threading pattern defines the most important parameters of the performance test scenario. For example, these are the number of threads(users), do they start together or with some delay, how long time they run, is there some delay after each run, etc

Here we presented some basic performance test examples.

Please have it in mind as on this page we will be adding just the extra code you will need to have.


Currently, ATS supports four types of threading patterns. They are the following:


All at once pattern

With this pattern, you can start a number of users all at the same time. The moment actions start executing is synchronized for all users. This means that practically there will be no delay between the start of the first and the last threads.

Here is a testcase running file transfer using the all-at-once pattern:

import com.axway.ats.agent.core.threading.patterns.AllAtOncePattern;

loader.setThreadingPattern( new AllAtOncePattern( 5, true ) );

This example runs 5 users, it starts them at the same time and each of them connects, uploads a file, and disconnects.

The Performance actions tab at the Test Explorer shows:

It should be easy to understand the info at this page and how it relates to your test code.

The Total execution time entry shows the time it took to execute once the whole iteration(which are all queued actions)

Many executions(iterations) of the same action queue

This example runs only iteration. If you need to do it for a number of times you have to change one line in the test example:

loader.setThreadingPattern( new AllAtOncePattern( 5, true, 10, 1000 ) );

Now we have requested that each thread will execute its action queue 10 times and there will be 1000 ms sleep after each iteration.

We run it again and here is the result:



Fixed duration all at once pattern

This pattern is almost the same as the all-at-once pattern. The difference is that instead of specifying the number of action queue iterations, we specify the duration for the action queue execution.


import com.axway.ats.agent.core.threading.patterns.FixedDurationAllAtOncePattern;

loader.setThreadingPattern( new FixedDurationAllAtOncePattern( 5, true, 20, 1000 ) );

Five threads are started. Each thread ran for 20 seconds and then exited. There was a 1000 ms delay between the iterations.

As you can see we have a total number of 28 executions which means some threads ran 6 times, while some slower threads managed to execute only 5 times before the deadline.



Ramp up pattern

Sometimes you do not want to start all your users at the same time, but you prefer to load the server slowly. In such a case you can use the ramp-up-pattern.

import com.axway.ats.agent.core.threading.patterns.RampUpPattern;

loader.setThreadingPattern( new RampUpPattern( 10, true, 5, 0, 2000, 2 ) );

We have changed only one line in our test and now we will start a total number of 10 threads(first parameter), but every 2000 ms(fifth parameter) it will start 2 new threads(sixth parameter). Each thread will execute its action queue 5 times(third parameter) and there will be no delay between each queue execution(fourth parameter).

The result regarding response times and transfer rates are not shown here as they are easy to understand, but have a look at this pic:

Here you can see how the number of running threads was changing according to the used pattern. Every 2 seconds another 2 threads get started until reach the total number of 10.
The thread that started first will eventually end first(all run for the same number of 5 iterations), so at the end, you see the number of threads is slowly going down.
Of course, the end of the graphic is not so well shaped as the beginning, the reason is that all threads do not do the transfer with the same exact speed.

This graphic with the number of running threads is made by using ATS Monitoring which is explained in details here



Fixed duration ramp up pattern

This pattern is almost the same as the ramp-up-pattern pattern. The difference is that instead of specifying the number of queue iterations, we specify the duration for the queue execution.

import com.axway.ats.agent.core.threading.patterns.FixedDurationRampUpPattern;

loader.setThreadingPattern( new FixedDurationRampUpPattern( 10, true, 60, 0, 2000, 2 ) );

Compared to the previous example, now the third parameter shows the threads will run for 60 seconds, while before they would run 5 iterations exactly.
Here is the user activity:



Back to parent page

Go to Table of Contents