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:
All listeners write the same raw data to the output file when one is specified.
The default items to be saved can be defined:
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:
or by using the Config popup as shown in the image below:
JMeter creates results of a test run as JTL (JMeter Text Logs). 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 to 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 minimise the amount of memory needed, use the Simple Data Writer, and use the 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:
|timeStamp||in milliseconds since 1/1/1970||1354223881017|
|label||sampler label||HTTP Request|
|responseCode||e.g. 200, 404||200|
|threadName||Thread Group 1-1|
|success||true or false||true|
|bytes||number of bytes in the sample||34908|
|grpThreads||number of active threads in this thread group||1|
|allThreads||total number of active threads in all groups||1|
|Filename||if Save Response to File was used|
|latency||time to first response||132|
|SampleCount||number of samples (1, unless multiple samples are aggregated)||1|
|ErrorCount||number of errors (0 or 1, unless multiple samples are aggregated)||0|
|Hostname||where the sample was generated||LaptopManisha|
|IdleTime||number of milliseconds of 'Idle' time (normally 0)|
Saving response data
The response data can be saved in the XML log file if required. But it has constraints, when the file is large and also images cannot be included. 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 Listener GUI data
JMeter is capable of saving any listener as a PNG file. To do so, select the listener in the left panel,
Edit > Save As Image.
A file dialog will appear. Enter the desired name and save the listener.