views:

84

answers:

1

I want to test concurrency, and reliably replicate an issue that JMeter brought to my attention.

What I want to do is set a unique identifier (currently the time in milliseconds with a counter appended) and increment the counter between loops but not between threads. The idea being that the number of threads I have set up is the number of identical identifiers before incrementing and using another.

If I had 3 threads with a loop count of 2 I want:

1. Unique ID: <current-time-in-millis>000000
2. Unique ID: <current-time-in-millis>000000
3. Unique ID: <current-time-in-millis>000000
4. Unique ID: <current-time-in-millis>000001
5. Unique ID: <current-time-in-millis>000001
6. Unique ID: <current-time-in-millis>000001

I've tried using Throughput Controllers to increment a counter, as well as several other things that seemed they should work but had no luck. This seems like something JMeter should be able to do. Is there any way to get the value of the loop count?

+1  A: 

Have you tried playing with the "track counter independently for each user" option on the pre-processor Counter element?

My understanding is that this should give you a separate counter for each thread group.

BlackGaff
Thank you! I had seen this option, and was sure I'd tried it. It seems to work perfectly now.
Dave Hunt
Glad it worked - enjoy!
BlackGaff