0

I am new to Jmeter and I'm looking to simulate a particular scenario. I need to run a set of Concurrency Thread groups, but I have to add a start-up delay for all the threads. (5 sec).

I have a thread group A (basic) which needs to run for the first 2 sec. After this, my set of Concurrency thread groups need to start (so after a startup delay of 3 sec).

I can achieve this through normal thread group, but how can I achieve this through concurrency thread group?

2 Answers2

0

You should use Ultimate Thread Group instead

"Ultimate" means there will be no need in further Thread Group plugins. The features that everyone needed in JMeter and they finally available:

  • infinite number of schedule records
  • separate ramp-up time

And put Initial Delay of 3 seconds

Community
  • 1
  • 1
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
0

You can implement the delay using the following approach

  1. Add JSR223 Sampler to be the first Sampler in your Concurrency Thread Group.
  2. Put the following code into "Script" area:

    SampleResult.setIgnore()
    if (vars.get('delay') == null) {
        Thread.sleep(3000)
        vars.put('delay', 'f')
    }
    
  3. Add Synchronizing Timer as a child of the JSR223 Sampler and make "Number of Simulated Users to Group by" equal to the desired concurrency

All threads will "meet" at the JSR223 Sampler, wait for 3 seconds and then start executing your other samplers.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Hi Dmitri, I tried this way but unfortunately none of the subsequent threads are getting started – sajinvarghese1990 Nov 05 '18 at 09:50
  • I cannot help without seeing your Concurrency Thread Group and Synchronizing Timer configurations. Contents of *jmeter.log* file can also shed some light on what's going on. – Dmitri T Nov 05 '18 at 09:51
  • Hi Dmitri, I'm trying to test an application where I need to do a Sign On call (API) initially and get a session token. And this session token i need to use in all my threads as Authentication header (HTTP). So I need to run only my Sign on call (normal thread) initially and get the token using Regex extractor. (This is done!). I need my other threads (concurreny threads) to start only after my normal thread – sajinvarghese1990 Nov 05 '18 at 11:49