My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
FlexibleFileWriter  

Listener
Updated Apr 28, 2012 by a...@apc.kg

Flexible File Writer since 0.4.1

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.

Header and Footer since 0.5.2

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.

Available Fields

startTime epoch time when request was started
endTime epoch time when reading response ended
responseTime response time, time to full response loaded
latency latency, time to first response byte received (if available)
responseCode response code (200, 404 etc.)
responseMessage response message (OK, Not Found etc.)
responseHeaders response headers (if present in sample)
responseData response data
requestData request data from sample
sentBytes number of request bytes sent, if available
receivedBytes number of request bytes sent (if available)
threadName name of thread in Thread Group that processed request
sampleLabel name of the sampler that made request
isSuccsessful is response was marked as successful
isFailed is response was marked as failed (surrogate field)
startTimeMillis same as startTime, but divided by 1000 (surrogate field, example: 1311121131.362)
endTimeMillis same as endTime, but divided by 1000 (surrogate field)
responseTimeMicros same as responseTime, but multiplied by 1000 (surrogate field)
latencyMicros same as latency, but multiplied by 1000 (surrogate field)
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

Comment by andrejva...@gmail.com, Jul 19, 2011

If I use threadName it gives me the sampleLabel. Visaversa, if I use sampleLabel it gives me the threadName.

startTimeMillis gives me the Epoch in seconds as a floating-point number, for example: "1311121131.362".

startTime gives the the Epoch in milliseconds as an integer.

Very confusing...

Also, I am missing and startTimeSec which is not a floating-point number but an integer. At least, that was what I was looking for to use in my test-case.

Comment by project member a...@apc.kg, Jul 20, 2011

Andrej, thanks you for this report and sorry for the bug. It will be fixed in 0.4.2 Improvement for startTimeSec accepted.

Comment by jongarfu...@gmail.com, Aug 30, 2011

Also, endTimeMillis is not giving me leading 0's in the fractional part (1314433867.16 instead of 1314433867.016)

Comment by project member a...@apc.kg, Aug 30, 2011

 Issue 75  accepted

Comment by ruthan...@gmail.com, Feb 1, 2012

It would be great have possiblity alo log the header.

Powered by Google Project Hosting