Executing dynamic workload by reading from a file

I’m reading data from a file which gives a “count of number of times” a function needs to be executed every minute. This data is for the whole day.
The problem which I’m facing is when I use stages, k6 is performing many iterations every minute and I’m not able to limit it to a particular number. When I’m not using stages and just using “iterations” inside “options” then I’m not able to change the value of “iterations” dynamically every minute.
I’m new to K6, is there any solution through which I can set the “iterations” value dynamically as per the count I’m getting from the file for every minute.
If you have any other solution, then feel free to share it with me. I’m open to new ideas as well!

Hi @saury1769 ,

In K6 there is a concept for manage the number of Virtual Users (VUs) , its name is Executors (Executors) and you set that in your OPTIONS section. Using that you can define the distribution of the users in the execution time and how they start to work.

In case you don’t want to use executors in the section OPTIONS from your test, i’m not sure if this is posible but maybe you can use metadata and set your values (k6/execution).

Hope it helps.

My workaround for this problem:
I created scenarios dynamically and chained them sequentially. This allowed me to mimic my workload from the excel file. For each scenario I was able to choose iterations dynamically.