0
votes

I have a JMeter (5.3) While Controller in a 1-user Thread Group, it reads a CSV and makes http calls for each row. I want all of these to complete as fast as possible (i.e. the loop completes uninterrupted), then the thread-group should pause, then I want the csv-loop to repeat*.

This is proving oddly difficult. Adding a Constant Timer below the While and it's (counter-intuitively) executed before the loop, yet I need it run immediately at start-up then subsequently delay. Similar SO posts advised a Flow Control Action, however the Pause doesn't actually pause for me. Others suggest adding a Constant Timer child to Flow Control, but it's utterly ignored. In both cases, the csv rows execute repeatedly with no delay at all.

Has anyone got a recipe for this: Process full csv file every few hours?
Simple to say, strangely hard to do.

My setup: The 'CSV Data Config' uses 'Recycle on EOF':True 'Stop thread on EOF':False. Flow Control Action has 'Pause' Duration: 0 with the child timer set to the desired delay.

Thank you.


* please don't ask why, just assume I truly want this.

1

1 Answers

0
votes

Flow Control Action, however the Pause doesn't actually pause for me.

This is kind of weird as it does work and introduces the pause when the thread reaches the sampler.

See the below image, with the Flow Control Action sampler disabled JMeter runs requests as fast as it can and when I enable it JMeter runs requests each 2 seconds according to the configured delay

enter image description here

With regards to "counter-intuitively" behaviour:

  1. As per Timers documentation:

    Note that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler.

    Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all. To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Flow Control Action Sampler.

  2. Timers also obey JMeter Scoping Rules