public class CsvDestination extends AbstractDestination
Measurement
into a CSV file.Modifier and Type | Class and Description |
---|---|
static class |
CsvDestination.AppendStrategy
Determines the strategy for a case that the output file exists.
|
static class |
CsvDestination.MissingStrategy
Determines the strategy for a case that the value of an expected attribute in report to be published is missing.
|
Constructor and Description |
---|
CsvDestination() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the destination.
|
CsvDestination.AppendStrategy |
getAppendStrategy()
Gets the current append strategy used to write results to the CSV file.
|
String |
getDelimiter()
Gets the line data elements delimiter.
|
String |
getExpectedAttributes()
Gets the exppected attributes that will be written to the CSV file.
|
List<String> |
getExpectedAttributesAsList()
Gets the exppected attributes that will be written to the CSV file as a List.
|
String |
getLineBreak()
Gets the delimiter used to separate individual lines in the output files.
|
String |
getLinePrefix()
Gets the data line prefix.
|
String |
getLineSuffix()
Gets the data line suffix.
|
CsvDestination.MissingStrategy |
getMissingStrategy()
Gets the current missing strategy used to write results to the CSV file.
|
String |
getPath()
Gets the currently used output file path.
|
boolean |
isSkipHeader()
When true, headers are not written to the output file.
|
void |
open()
Opens the destination for reporting.
|
void |
report(Measurement measurement)
Reports a new
Measurement to the destination. |
CsvDestination |
setAppendStrategy(CsvDestination.AppendStrategy appendStrategy)
Sets the append strategy to be used when writing to the CSV file.
|
CsvDestination |
setDelimiter(String delimiter)
Sets the delimiter used in a line between individual data elements.
|
CsvDestination |
setExpectedAttributes(String expectedAttributes)
Sets the exppected attributes that will be written to the CSV file.
|
CsvDestination |
setLineBreak(String lineBreak)
Sets the delimiter used to separate individual lines in the output files.
|
CsvDestination |
setLinePrefix(String linePrefix)
Sets the data line prefix.
|
CsvDestination |
setLineSuffix(String lineSuffix)
Sets the data line suffix.
|
CsvDestination |
setMissingStrategy(CsvDestination.MissingStrategy missingStrategy)
Sets the missing strategy to be used when writing to the CSV file.
|
CsvDestination |
setPath(String path)
Sets the output file path.
|
CsvDestination |
setSkipHeader(boolean skipHeader)
Specifies whether headers should be ommited from the output file.
|
getParentReporter, open
public void open()
AbstractDestination
open
in class AbstractDestination
public void close()
Destination
public void report(Measurement measurement) throws ReportingException
Destination
Measurement
to the destination.measurement
- A measurement to be reported.ReportingException
- When an error occurred during reporting the measurement like no space left on device. The root cause should be encapsulated.public String getPath()
public CsvDestination setPath(String path)
path
- The output file path to be set.public String getDelimiter()
public CsvDestination setDelimiter(String delimiter)
delimiter
- The delimiter to be used between data elements in an output line.public CsvDestination.AppendStrategy getAppendStrategy()
public CsvDestination setAppendStrategy(CsvDestination.AppendStrategy appendStrategy)
appendStrategy
- The appendStrategy value to set.public CsvDestination.MissingStrategy getMissingStrategy()
public CsvDestination setMissingStrategy(CsvDestination.MissingStrategy missingStrategy)
missingStrategy
- The missingStrategy value to set.public String getExpectedAttributes()
public CsvDestination setExpectedAttributes(String expectedAttributes)
expectedAttributes
- The exppected attributes separated by comma.public List<String> getExpectedAttributesAsList()
public String getLinePrefix()
public CsvDestination setLinePrefix(String linePrefix)
linePrefix
- The data lines prefix.public String getLineSuffix()
public CsvDestination setLineSuffix(String lineSuffix)
lineSuffix
- The data lines suffix.public String getLineBreak()
public CsvDestination setLineBreak(String lineBreak)
lineBreak
- The delimiter used to separate output lines.public boolean isSkipHeader()
public CsvDestination setSkipHeader(boolean skipHeader)
skipHeader
- When set to true, headers are not written.Copyright © 2010–2017 PerfCake Community. All rights reserved.