|
Apache JMeter | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.jmeter.save.CSVSaveService
public final class CSVSaveService
This class provides a means for saving/reading test results as CSV files.
| Field Summary | |
|---|---|
static char |
QUOTING_CHAR
|
| Method Summary | |
|---|---|
static java.lang.String[] |
csvReadFile(java.io.BufferedReader infile,
char delim)
Reads from file and splits input into strings according to the delimiter, taking note of quoted strings. |
static java.lang.String[] |
csvSplitString(java.lang.String line,
char delim)
Reads from String and splits into strings according to the delimiter, taking note of quoted strings. |
static SampleSaveConfiguration |
getSampleSaveConfiguration(java.lang.String headerLine,
java.lang.String filename)
Parse a CSV header line |
static SampleEvent |
makeResultFromDelimitedString(java.lang.String inputLine,
SampleSaveConfiguration saveConfig,
long lineNumber)
Deprecated. Does not handle quoted strings; use processSamples(String, Visualizer, ResultCollector) instead |
static java.lang.String |
printableFieldNamesToString()
Generates the field names for the output file |
static java.lang.String |
printableFieldNamesToString(SampleSaveConfiguration saveConfig)
Generates the field names for the output file |
static void |
processSamples(java.lang.String filename,
Visualizer visualizer,
ResultCollector resultCollector)
Read Samples from a file; handles quoted strings. |
static java.lang.String |
resultToDelimitedString(SampleEvent event)
Convert a result into a string, where the fields of the result are separated by the default delimiter. |
static java.lang.String |
resultToDelimitedString(SampleEvent event,
java.lang.String delimiter)
Convert a result into a string, where the fields of the result are separated by a specified String. |
static void |
saveCSVStats(javax.swing.table.DefaultTableModel model,
java.io.FileWriter writer)
Method saves aggregate statistics as CSV from a table model. |
static void |
saveCSVStats(java.util.Vector data,
java.io.FileWriter writer)
Method will save aggregate statistics as CSV. |
static void |
saveCSVStats(java.util.Vector data,
java.io.FileWriter writer,
java.lang.String[] headers)
Method will save aggregate statistics as CSV. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char QUOTING_CHAR
| Method Detail |
|---|
public static void processSamples(java.lang.String filename,
Visualizer visualizer,
ResultCollector resultCollector)
throws java.io.IOException
filename - input filevisualizer - where to send the resultsresultCollector - the parent collector
java.io.IOException
public static SampleEvent makeResultFromDelimitedString(java.lang.String inputLine,
SampleSaveConfiguration saveConfig,
long lineNumber)
processSamples(String, Visualizer, ResultCollector) instead
inputLine - - line from CSV filesaveConfig - - configurationlineNumber - - line number for error reporting
JMeterErrorpublic static java.lang.String printableFieldNamesToString()
public static java.lang.String printableFieldNamesToString(SampleSaveConfiguration saveConfig)
public static SampleSaveConfiguration getSampleSaveConfiguration(java.lang.String headerLine,
java.lang.String filename)
headerLine - from CSV filefilename - name of file (for log message only)
public static void saveCSVStats(java.util.Vector data,
java.io.FileWriter writer)
throws java.io.IOException
data - vector of data rowswriter - output file
java.io.IOException
public static void saveCSVStats(java.util.Vector data,
java.io.FileWriter writer,
java.lang.String[] headers)
throws java.io.IOException
data - vector of data rowswriter - output fileheaders - header names (if non-null)
java.io.IOException
public static void saveCSVStats(javax.swing.table.DefaultTableModel model,
java.io.FileWriter writer)
throws java.io.IOException
saveCSVStats(Vector, FileWriter, String[]) except
that there is no need to create a Vector containing the data.
model - table model containing the datawriter - output file
java.io.IOExceptionpublic static java.lang.String resultToDelimitedString(SampleEvent event)
event - the sample event to be converted
public static java.lang.String resultToDelimitedString(SampleEvent event,
java.lang.String delimiter)
event - the sample event to be converteddelimiter - the separation string
public static java.lang.String[] csvReadFile(java.io.BufferedReader infile,
char delim)
throws java.io.IOException
Handles DOS (CRLF), Unix (LF), and Mac (CR) line-endings equally.
N.B. a blank line is returned as a zero length array, whereas "" is returned as an empty string. This is inconsistent.
infile - input file - must support mark(1)delim - delimiter (e.g. comma)
java.io.IOException - also for unexpected quote characters
public static java.lang.String[] csvSplitString(java.lang.String line,
char delim)
throws java.io.IOException
line - input linedelim - delimiter (e.g. comma)
java.io.IOException - also for unexpected quote characters
|
Apache JMeter | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||