jMeter - Listeners

Listeners provide access to the information JMeter gathers about the test cases while JMeter runs. The results or information gathered by listeners can be shown in the form of −
  • tree
  • tables
  • graphs
  • log file
All listeners write the same raw data to the output file when one is specified.

Default Configuration

The default items to be saved can be defined in one of the following two ways −
  • In the jmeter.properties (or user.properties) file. This file is present in the /bin folder of JMeter.To change the default format, find the following line in jmeter.properties −
jmeter.save.saveservice.output_format=
  • By using the Config popup as shown in the following screenshot −
JMeter Config PopUp
JMeter creates results of a test run as JMeter Text Logs(JTL). These are normally called JTL files, as that is the default extension − but any extension can be used.
If multiple tests are run using the same output file name, then JMeter automatically appends new data at the end of the file.
The listener can record results to a file but not to the UI. It is meant to provide an efficient means of recording data by eliminating GUI overhead.
When running in −
  • GUI mode − use the listener Simple Data Writer
  • non-GUI mode − the -l flag can be used to create a data file.
Listeners can use a lot of memory if there are a lot of samples. To minimize the amount of memory needed, use the Simple Data Write with CSV format.

CSV Log format

The CSV log format depends on which data items are selected in the configuration. Only the specified data items are recorded in the file. The order of appearance of columns is fixed, and is as follows −
FieldDescriptionValue Example
timeStampin milliseconds since 1/1/19701354223881017
elapsedin milliseconds1858
labelsampler labelHTTP Request
responseCodee.g. 200, 404200
responseMessagee.g. OKOK
threadNameThread Group 1-1
dataTypee.g. texttext
successtrue or falsetrue
failureMessageif any
bytesnumber of bytes in the sample34908
grpThreadsnumber of active threads in this thread group1
allThreadstotal number of active threads in all groups1
URLhttp://tutorialspoint.com
Filenameif Save Response to File was used
latencytime to first response132
encodingutf-8
SampleCountnumber of samples (1, unless multiple samples are aggregated)1
ErrorCountnumber of errors (0 or 1, unless multiple samples are aggregated)0
Hostnamewhere the sample was generatedLaptopManisha
IdleTimenumber of milliseconds of 'Idle' time (normally 0)
Variablesif specified

Saving Response Data

The response data can be saved in the XML log file if required. However it does not allow to save large files and images. In such cases, use the Post-Processor Save_Responses_to_a_file. This generates a new file for each sample, and saves the file name with the sample. The file name can then be included in the sample log output. The data will be retrieved from the file if necessary when the sample log file is reloaded.

Loading (reading) response data

To view an existing results file, you can use the file "Browse..." button to select a file. If necessary, just create a dummy testplan with the appropriate Listener in it.

Saving the Listener GUI Data

JMeter is capable of saving any listener as a PNG file. To do so,
  • Select the listener in the left panel by selecting Edit > Save As Image. A file dialog appears.
  • Enter the desired name.
  • Save the listener.