2017-02-17 29 views
2

有沒有什麼方法可以在CSV數據集配置中使用「編輯」「共享模式」這個選項?我在官方網站上找到了描述?如何使用CSV Config Set的共享模式在Jmeter中運行線程?

apache jmeter component CSV Data Set Config

標識符 - 所有線程共享相同的標識共享相同的 文件。例如,如果您有4個線程組,則可以使用兩個或多個組的 公用標識來共享 之間的文件。或者您可以使用線程號在不同線程組中的 相同線程號之間共享文件。

但我不明白常見的id和線程數的意思是什麼?我如何將它們用於特定的線程?

回答

3

例如,你有file.csv具有以下內容:

line1 
line2 
line3 
line4 

而且2 Thread Groups跟2個用戶和1個循環執行採樣帶以下標籤:

Sampler ${__threadNum} - ${foo} 

對於不同的共享模式設置你會得到不同的行爲,即:

  • 對於共享模式All Threads

    Sampler 1 - line1 
    Sampler 1 - line2 
    Sampler 2 - line3 
    Sampler 2 - line4 
    
  • 對於共享模式Current Thread Group您將獲得:

    Sampler 1 - line1 
    Sampler 1 - line1 
    Sampler 2 - line2 
    Sampler 2 - line2 
    
  • 對於共享模式Current Thread您將獲得:

    Sampler 1 - line1 
    Sampler 1 - line1 
    Sampler 2 - line1 
    Sampler 2 - line1 
    
  • 對於共享模式${__threadNum}你會得到:

    Sampler 1 - line1 
    Sampler 1 - line2 
    Sampler 2 - line1 
    Sampler 2 - line2 
    

Test Plan

JMeter CSV Data Set Config ThreadNum

參考文獻:

相關問題