Forum Discussion
sinnes_1
16 years agoOccasional Contributor
I think I've answered my own question. I didn't google hard enough 
This will set threadIndex to be the index number of the thread. Example groovy script:
If you run that as a load test with 5 threads, your output will look something like this:
Now, where can I find the different values I can get from context??

def threadIndex = context.ThreadIndex;
This will set threadIndex to be the index number of the thread. Example groovy script:
def threadIndex = context.ThreadIndex;
System.out.println("Hi, I'm thread "+threadIndex);
If you run that as a load test with 5 threads, your output will look something like this:
Hi, I'm thread 2
Hi, I'm thread 0
Hi, I'm thread 1
Hi, I'm thread 4
Hi, I'm thread 3
Hi, I'm thread 0
Hi, I'm thread 1
Hi, I'm thread 2
Hi, I'm thread 4
Hi, I'm thread 3
Now, where can I find the different values I can get from context??