1

I have made a selection form a huge amount of ID's, using the following query:

select ID from [tabelname] where id > 0 and id < 31

This gives me 30 ID's to work with.

What I would like to do now, is to use 3 threads, with the first one using ID 1, 4, 7, 10 etc, the second ID 2, 5, 8, 11 etc and the third one ID 3, 6, 9, 12 etc.

Up until now, I have only been able to have all threads use ID 1 through 30 parallel to each other. Would it be at all possible to do this?

Thanks in advance!

jarlh
  • 42,561
  • 8
  • 45
  • 63
  • So having 3 threads picking at random ID in range 1-30 using counter is not an acceptable solution? Can you be more specific about your goal? – timbre timbre May 30 '16 at 20:43
  • Did you try "in" operator select id from [tablename] where id in (1,4,7,10...) – Vikas Madhusudana May 31 '16 at 05:14
  • Random is unfortunately not an option. I have to use the same population several times, for several operations. The 'in' operator is not an option either. The whole population is over 15 million and we need a 1% representation. Basically, is it possible to have several threads and have each of those use their own population? And how do I assign these? – Willem Barsati Jun 01 '16 at 07:07

1 Answers1

1

JMeter has a build-in operation that you can use in combination with a pre-processor to find the current thread number:

https://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html#getThreadNum()

If you now use ctx.getThreadGroup().getNumThreads() to find the number of threads you're using, you can basically divide your testset into subsets and let each thread compute on its own subset (e.g. thread1 computes on 0..10, thread2 on 11..20, thread3 on 21..30, etc..)

RJ Pijpker
  • 76
  • 4