In most cases, Object Storage Service (OSS) data sources are used together with parameter nodes in scenarios in which custom stress testing requests are required, such as user logon simulation scenarios.
Parameter file conventions
CSV and ZIP files are supported. A ZIP compressed package can contain only one CSV file.
NoteDo not change the file extension of an XLSX file to generate a CSV file. We recommend that you use programs, such as Excel or Numbers, to save an XLSX file as a CSV file or use the Apache Commons CSV program to generate a CSV file.
The size of a parameter file cannot exceed 2 GB. Each row can contain up to 20,000 characters.
If you want to combine multiple sets of data into a set of parameters on a parameter node, you do not need to store the data in a single file. You can combine the data in multiple files into a set of parameters on the Data Source Parameters tab of the parameter node.
If you reference parameters from multiple files, you can specify a parameter as the baseline column. This way, the file that contains the parameter is used as the benchmark file. If you do not select Baseline Column or Use Once for the parameters, the system specifies a random parameter as the baseline column. For more information, see PTS read method of multi-file parameters in virtual user or RPS mode.
If parameters have mandatory one-to-one mappings, you must store the parameters in a single file and properly configure the mappings. Make sure that all columns in a row contain complete data. Otherwise, empty fields appear, which may affect the stress testing data.
The following sample code provides an example of the file content. If the data in the first row of a parameter file is not parameter names, you must specify a parameter name for each column based on your business scenario.
username,password user1,Password1 user2,Password2 user3,Password3
Obtain the URL of an OSS bucket to obtain the parameter file stored in the bucket
Log on to the OSS console. In the left-side navigation pane, click Buckets. On the page that appears, click the name of the OSS bucket from which you want to import a parameter file.
On the Objects page, click the name of the object that you want to import or click View Details in the Actions column that corresponds to the object.
In the View Details panel, click Set ACL in the lower-right corner. In the panel that appears, select Public Read and click OK.
In the View Details panel of the object, click Copy Object URL.
Import a parameter file to add a data source
Log on to the PTS console, choose , and then click JMeter.
Click Data Sources. On the OSS Files tab, click Add. In the dialog box that appears, paste the copied URL of the OSS object and click OK.
Click Import.
Click Save.
Go back to the JMeter Scenario page and click Save Settings. The parameter file is added to the Scenario Settings section.