What is the actual difference between Sharing mode "All threads" and "Current thread group" in Jmeter?
Can anyone explain in detail?
I have one liner definition but i am not able to understand it properly.
Thanks, Rishil
Well, as per reference:
• All threads - (the default) the file is shared between all the threads.
• Current thread group - each file is opened once for each thread group in which the element appears
So in case of "All threads" if you have in your script more than 1 CSV Data Set Config elements that refer the same file the next CSV Data Set Config element will CONTINUE READING from previously opened file (i.e. in prevoius CSV Data Set Config element), and in case of "Current thread group" each subsequent CSV Data Set Config element will REOPEN your file.
Please look onto example below:
In this case each CSV Data Set Config element:
• uses the same csv-file;
• reads file once and till the EOF;
• reads file from beginning: file is re-opened each time because of Sharing Mode = Current thread group.
If in this case change Sharing Mode to "All threads" WITHOUT any other changes the 2nd (TG-04) and the 3rd (TG-05) CSV Data Set Config elements will read nothing because the csv-file will remain open after TG-03 and file cursor will point to end of file.
Implementation details find in CSVDataSet class description:
The class uses the FileServer alias mechanism to provide the different share modes. For all threads, the file alias is set to the file name. Otherwise, a suffix is appended to the filename to make it unique within the required context. For current thread group, the thread group identityHashcode is used; for individual threads, the thread hashcode is used as the suffix.
UPDATE 2012-02-09:
Presume you have configuration as in comment below:
So you will get:
1. N appearances - in case of Sharing mode = "All threads" or "Current thread group": each thread will read 1 entry from csv: the 1st thread - the 1st entry, ..., the Nth thread - the Nth entry.
2. N*N appearances - in case of Sharing mode = "Current thread": each thread will read ALL the entries from csv.
Both the statements are for the case when CSV Data Set Config set with the following settings:
Recycle on EOF? = false Stop thread on EOF? = false
(screenshot above).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With