Search code examples
datejmeterreport

How to set the current date in the html report ("Start Time" section) in JMeter?


I try to generate a dashboard report from JMeter results and faced the issue, some graphs have an incorrect elapsed time (00:00:00):

incorrect elapsed time

Also, I saw that "Start Time" is incorrect ("1/1/70 2:00 AM"), but at the same time "End Time" is incorrect:

correct elapsed time

I assume that this incorrect date is a cause of incorrect graphs. How I can fix it?

P.S. I ran the test from non-GUI mode


Solution

  • Looking into reportgenerator.properties

    # Used to generate a report based on a date range
    # If jmeter.save.saveservice.timestamp_format does not contain year
    # then use 1970 as year
    

    Looking into Results File Configuration

    jmeter.save.saveservice.timestamp_format Timestamp format - this only affects CSV output files. Legitimate values: none, ms, or a format suitable for SimpleDateFormat. Defaults to: ms No

    jmeter.save.saveservice.timestamp_format Defaults to: yyyy/MM/dd HH:mm:ss.SSS

    So my expectation is that you need to add the next line to user.properties file:

    jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS
    

    and on next test execution you should see "normal" start date in the reporting dashboard.

    More information: Apache JMeter Properties Customization Guide