2 Minutes To Code (β Version)

JMeter - 2 minute tutorial

Example of Simple Data Writer Listener (sample usage)

Simple Data Writer just logs the results in a flat file. It does not display results on JMeter's GUI. Let's see an example of Simple Data Writer in use.

Image 1 shows how to add a Simple Data Writer listener.

Image 2 shows how to specify a file name for the log file.

Image 3 & Image 4 shows how to configure the fields that you want to log, to select xml or csv format for results file etc.

Output 1 shows the contents of log file created by Simple data Writer with default settings.

Output 2 shows the contents of log file created by Simple Data Writer in csv format (the filed Save as XML un-checked) with http urls (the field Save Url chacked.)


Image 1 : Adding a Simple Data Writer listener Top Of Page


Image 2 : Configuring file name for Simple Data Writer Top Of Page


Image 3 : Configure button of Simple Data Writer Top Of Page


Image 4 : Configuring field names for Simple Data Writer Top Of Page


Output 1 : Default output file
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">

<httpSample t="318" lt="176" ts="1347687818528" s="true" lb="Home  Request" rc="200" rm="OK" tn="TG 1-1" dt="text" by="12860"/>
<httpSample t="335" lt="201" ts="1347687818530" s="true" lb="Home  Request" rc="200" rm="OK" tn="TG 1-3" dt="text" by="12828"/>
<httpSample t="355" lt="230" ts="1347687818530" s="true" lb="Home  Request" rc="200" rm="OK" tn="TG 1-4" dt="text" by="12816"/>
<httpSample t="376" lt="259" ts="1347687818529" s="true" lb="Home  Request" rc="200" rm="OK" tn="TG 1-2" dt="text" by="12876"/>
<httpSample t="406" lt="285" ts="1347687818531" s="true" lb="Home  Request" rc="200" rm="OK" tn="TG 1-5" dt="text" by="15982"/>

</testResults>
Top Of Page


Output 2 : Output file in csv format with http urls
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,bytes,URL,Latency
1347687937244,319,Home  Request,200,OK,TG 1-1,text,true,12844,http://www.example.com/,176
1347687937246,337,Home  Request,200,OK,TG 1-5,text,true,12828,http://www.example.com/,202
1347687937245,358,Home  Request,200,OK,TG 1-3,text,true,12860,http://www.example.com/,232
1347687937246,377,Home  Request,200,OK,TG 1-4,text,true,12848,http://www.example.com/,259
1347687937247,396,Home  Request,200,OK,TG 1-2,text,true,12848,http://www.example.com/,286
 
Top Of Page