Package org.apache.jmeter.report.core
Class CsvSampleWriter
java.lang.Object
org.apache.jmeter.report.core.SampleWriter
org.apache.jmeter.report.core.AbstractSampleWriter
org.apache.jmeter.report.core.CsvSampleWriter
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Class to be used to write samples to a csv destination (OutputStream, Writer
 or a File).
 
 This class handles csv header writing with the writeHeader
 method. This method has to be called by user for the header to be written.
 
- Since:
- 3.0
- 
Field SummaryFields inherited from class org.apache.jmeter.report.core.AbstractSampleWriterwriter
- 
Constructor SummaryConstructorsConstructorDescriptionCsvSampleWriter(File output, SampleMetadata metadata) CsvSampleWriter(OutputStream output, SampleMetadata metadata) CsvSampleWriter(Writer output, SampleMetadata metadata) CsvSampleWriter(SampleMetadata metadata) The new instance has to be supplied with a Writer to work properly.
- 
Method SummaryModifier and TypeMethodDescriptionvoidsetSeparator(char separator) Set the char to use for separation of data in a line.voidSet the new writer on which samples will be written by this sample writer.
 If any writer exists on the sample writer, it is flushed and closed before being replaced by the new one.longWrite a sample to the underlying destinationvoidWrite the csv header.Methods inherited from class org.apache.jmeter.report.core.AbstractSampleWriterclose, setOutputFile, setOutputStream
- 
Constructor Details- 
CsvSampleWriterThe new instance has to be supplied with a Writer to work properly.- Parameters:
- metadata- the description for data that this writer will write (- metadatamust not be- null).
 
- 
CsvSampleWriter- Parameters:
- output- the writer to write data to. (Must not be- null)
- metadata- the description for data that this writer will write. (- metadatamust not be- null.)
 
- 
CsvSampleWriter- Parameters:
- output- the output stream to write data to. (Must not be- null)
- metadata- the description for data that this writer will write. (- metadatamust not be- null.)
 
- 
CsvSampleWriter- Parameters:
- output- the output file to write data to. (Must not be- null)
- metadata- the description for data that this writer will write. (- metadatamust not be- null.)
 
 
- 
- 
Method Details- 
setSeparatorpublic void setSeparator(char separator) Set the char to use for separation of data in a line.- Parameters:
- separator- to use
 
- 
setWriterDescription copied from class:AbstractSampleWriterSet the new writer on which samples will be written by this sample writer.
 If any writer exists on the sample writer, it is flushed and closed before being replaced by the new one.- Overrides:
- setWriterin class- AbstractSampleWriter
- Parameters:
- writer- The destination writer where samples will be written by this sample writer
 
- 
writeHeaderpublic void writeHeader()Write the csv header. If samples have already been written then a row with header information will be written in the middle of the file.
- 
writeDescription copied from class:SampleWriterWrite a sample to the underlying destination- Specified by:
- writein class- SampleWriter
- Parameters:
- sample- The sample to be written (Must not be- null)
- Returns:
- The number of samples written at this time to the underlying destination
 
 
-