What are JTL files?

JMeter can create text files containing the results of a test run.

These are normally called JTL files, as that is the default extension - but any extension can be used.

Configuration

The format is defined by the Listener "Config" button, see:

http://jmeter.apache.org/usermanual/component_reference.html#Sample_Result_Save_Configuration

The configuration for files specified by the -l command-line flag is defined by the jmeter.properties entries.

Types of JTL file

There are currently two types of JTL file:

  • XML
  • CSV (with and without header)

The XML files can contain more types of information, but are considerably larger.

Merging JTL files

If multiple tests are run using the same output file name, then JMeter automatically appends new data to the end of the file.

However, there may be occasions when you want to combine multiple files: for example if a test was run in non-GUI mode on multiple hosts, each host will generate its own file.

Note that currently the JTL files don't include details of the hostname where the test was run. The hostname can be included in sample labels by using the __machineName() function.

If you need to distinguish the different samples after merging, you could pre-process the files to add a marker to each sample label.

Merging CSV format files

This can only be done if the same field (column) settings were used for each file.

The files can be concatenated.

This will probably result in multiple header lines. The duplicates need to be removed, and the remaining header line moved to the start of the file if necessary.

Depending on how you intend to use the merged file, it may be necessary to sort the resulting file using the timestamp.

Note that even a single JTL may contain entries where the timestamps are out of order. This is because the timestamps (by default) are start times, whereas the samples are generated in order of end times.

Merging XML format files

These have the format:

<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<sample ... />
...
<sample ... />

</testResults>

The files can be concatenated, and the additional embedded trailers and headers removed.

It's probably possible to automate this with suitable XSL files (contributions welcome).

Likewise, the contents can probaby be sorted if necessary using XSLT.

  • No labels