JMeter JTL Files
When capturing Apache JMeter test results, typically the data is written to a log file (JTL file).
JTL file structure
The header line of the JTL file contains column names. The remainder of the file reports the test points, each on a single line.
The timeStamp captured, is a Epoch timestamp which is the time since 1st Jan 1970. Typically, this value is 10 digit long but Apache JMeter adds 3 more characters of precision. In this example 1541088455861 equates to 11/01/2018 @ 1607 (UTC).
There are also measures of threads, time, response, failures and bytes.
Editing JTL files
Generating HTML test reports from a JTL file will include data from every line within the file.
There may be occasions where sections of the data need to be removed, such as a ramp-up or ramp-down. If you know the time of these data points, you can simply get the epoch timestamp for the times and search for them within the file.
For example we can simply remove the top 5 lines and the bottom 5 lines within this JTL file. Then either overwrite the file or save it as a new file to preserve the original file. The HTML Report would then target just the data that we wished to report on.
Fixing damaged files
If a test was to fail or the java process terminated ,the JTL file may become damaged. Since it is a plain text file it is relatively easy to repair.
Typically, what happens is the end line in the file, will not be fully written. If this happens when you try to generate a HTML report it will fail stating that the number of columns is incorrect.
To fix this simply remove the line and save the file.
Unexpected Strings
There are occasions where failure messages may introduce problematic data into the JTL file. Since the file is typically comma separated, if a comma is returned and written to the file it will cause the column number to mismatch and therefore cause the HTML report generation to fail.
To fix this you can search through the file to identify the failure message and simply remove the extra comma. Then re-save the file and generate the HTML report.