Class CsvFileSampleSource
java.lang.Object
org.apache.jmeter.report.processor.AbstractSampleSource
org.apache.jmeter.report.processor.CsvFileSampleSource
- All Implemented Interfaces:
- Runnable,- SampleSource
Read a csv source file and write its rows (samples) all the registered
 
If there is several other source files with the same root name then those files are produced on their corresponding channels.
 
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.csvthen it will be produced on the channel 1.
- If the input file is named results-2.csvthen it will be produced on the channel 2.
- If the input file is named results.csvthen it will be produced on the channel 0.
- Since:
- 3.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringFile name whose sample are being produced on the channel
- 
Constructor SummaryConstructorsConstructorDescriptionCsvFileSampleSource(File inputFile, char separator) Build a sample source from the specified input file and character separator.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSampleConsumer(SampleConsumer consumer) Add a sample consumer to this sample source.voidremoveSampleConsumer(SampleConsumer consumer) Remove a sample consumer from this sample source.voidrun()Run this sample source.
 This sample source will start reading all inputs CSV files and produce their samples to this sample source registered sample consumers.voidsetSampleConsumers(List<SampleConsumer> consumers) Sets the specified sample consumers that will consume samples produced by this sample source.Methods inherited from class org.apache.jmeter.report.processor.AbstractSampleSourcegetSampleContext, setSampleContext
- 
Field Details- 
SOURCE_FILE_ATTRIBUTEFile name whose sample are being produced on the channel- See Also:
 
 
- 
- 
Constructor Details- 
CsvFileSampleSourceBuild 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- 
setSampleConsumersDescription copied from interface:SampleSourceSets the specified sample consumers that will consume samples produced by this sample source.- Specified by:
- setSampleConsumersin interface- SampleSource
- Specified by:
- setSampleConsumersin class- AbstractSampleSource
- Parameters:
- consumers- consumers to be set
 
- 
addSampleConsumerDescription copied from interface:SampleSourceAdd a sample consumer to this sample source.- Specified by:
- addSampleConsumerin interface- SampleSource
- Specified by:
- addSampleConsumerin class- AbstractSampleSource
- Parameters:
- consumer- consumer to be added
 
- 
removeSampleConsumerDescription copied from interface:SampleSourceRemove a sample consumer from this sample source.- Specified by:
- removeSampleConsumerin interface- SampleSource
- Specified by:
- removeSampleConsumerin class- AbstractSampleSource
- Parameters:
- consumer- consumer to be removed
 
- 
runpublic void run()Run this sample source.
 This sample source will start reading all inputs CSV files and produce their samples to this sample source registered sample consumers.- Specified by:
- runin interface- Runnable
- Specified by:
- runin class- AbstractSampleSource
 
 
-