Class CsvFileSampleSource

java.lang.Object
org.apache.jmeter.report.processor.AbstractSampleSource
org.apache.jmeter.report.processor.CsvFileSampleSource
All Implemented Interfaces:
Runnable, SampleSource

public class CsvFileSampleSource extends AbstractSampleSource
Read a csv source file and write its rows (samples) all the registered SampleConsumers.
If there is several other source files with the same root name then those files are produced on their corresponding channels.

The root name of the files is determined by the source file name and is made of its name without the file extension :
Example: If results.csv is the source file name then results is the root file name.

The CsvFileSampleSource looks for all the files in the same directory of the main source file that have the same root file name
Example : if the directory contains results.csv, results-1.csv, results-2.csv, etc. then all these files will be read and produced on their corresponding channels.
The channel on which an input file will be produce is determined by its suffix

  • If the input file is named results-1.csv then it will be produced on the channel 1.
  • If the input file is named results-2.csv then it will be produced on the channel 2.
  • If the input file is named results.csv then it will be produced on the channel 0.
Since:
3.0
  • Field Details

    • SOURCE_FILE_ATTRIBUTE

      public static final String SOURCE_FILE_ATTRIBUTE
      File name whose sample are being produced on the channel
      See Also:
  • Constructor Details

    • CsvFileSampleSource

      public CsvFileSampleSource(File inputFile, char separator)
      Build a sample source from the specified input file and character separator.
      Parameters:
      inputFile - The input sample file (CSV file) (must not be null)
      separator - The character separator to be used for delimiting samples columns
  • Method Details