Flexible File Writer

Download

JMeter has very simpe test results writing capabilities with Simple Data Writer plugin. File formats restricted to XML and CSV, fields order predefined. So you may find Simple Data Writer not enough for your task.

Flexible File Writer plugin allows writing test results in flexible format, specified via GUI.

Make note that JMeter variables/functions in filename field processed only once when test starts and file opened for writing.

If your format requires some header and/or footer, you may specify it in corresponding fields. FFW will write header once it opened file and footer right before closing it.

Record Specification

Record specification may consist of fields specification and string constants. Fields are separated from constants with '|' symbols. Plugin will not add any extra bytes to file, so you must specify newline characters manually (\r, \n, \t works for newlines and tabs).

For example, simple tab separated file specified as:

    startTime|\t|responseTime|\t|responseCode|\t|isSuccsessful|\r\n

If you want to have '|' symbol itself to be written to file, use '||' in record specification.

There is special property named kg.apc.jmeter.reporters.FFWBufferSize with default of 10KB. This property controls the size for the buffer used to compose record to write to file. See https://groups.google.com/forum/#!topic/jmeter-plugins/Mldv8vs2L3g for some more details.

Available Fields

startTimeepoch time when request was started
endTimeepoch time when reading response ended
responseTimeresponse time, time to full response loaded
latencylatency, time to first response byte received (if available)
connectTimetime to establish connection (if available)
responseCoderesponse code (200, 404 etc.)
responseMessageresponse message (OK, Not Found etc.)
responseHeadersresponse headers (if present in sample)
responseDataresponse data
requestDatarequest data from sample
sentBytesnumber of request bytes sent, if available
receivedBytesnumber of request bytes sent (if available)
threadNamename of thread in Thread Group that processed request
threadsCountoverall active threads count (since version 1.1.0)
sampleLabelname of the sampler that made request
isSuccsessfulis response was marked as successful
isFailedis response was marked as failed (surrogate field)
startTimeMillissame as startTime, but divided by 1000 (surrogate field, example: 1311121131.362)
endTimeMillissame as endTime, but divided by 1000 (surrogate field)
responseTimeMicrossame as responseTime, but multiplied by 1000 (surrogate field)
latencyMicrossame as latency, but multiplied by 1000 (surrogate field)
grpThreadsnumber of active threads in this thread group
sampleCountnumber of samples (1, unless multiple samples are aggregated)
errorCountnumber of errors (0 or 1, unless multiple samples are aggregated)
URLThe sample URL
variable#<N>Sample variable with index N, see below for details

Saving JMeter Variables with Flexible File Writer

Jmeter have feature to specify some variables to be saved in result files. You may find here JMeter doc on setting up saving. Shortly is you have to specify JMeter property sample_variables to save variables by name, for instance, with command line property setting -Jsample_variables=var1,var2, or just in user.properties file. It turns out that JMeter have no API to change sample_variables setting during runtime, so we have to rely on pre-run property setting. Flexible File Writer can then use those variables to save in file, you need to specify field variable#0 in record specification. Variable indexes are zero based, e.g. var1 have index '0', var2 have index '1'.

Example and Tutorials

Download Example Test Plan

Tutorials