Main menu

"Goodbye, Jean-Luc, I'm gonna miss you. You had such potential. But then again, all good things must come to an end."
- Q, Star Trek: TNG

Changing JMeter's Time Stamp Format

by Ken Newquist / March 20, 2007

JMeter is a cool open source tool for evaluating the load performance of web servers. You can setup scripts that have computer-controlled users login to a web site, do something, and then log out, and log the results while it's doing it. This allows you to easily simulate a few hundred people hitting a site simultaneously, which is something I need to do at the day job.

This is great, but by by default JMeter uses 13-digit Unix time stamps, which overs microsecond accuracy but also plays havoc with most other programs (like say, Excel or PHP's date function) that are expecting a 10-digit Unix time stamp. Fortunately, after some digging around I found this "Running JMeter" page which mentions editing the "jmeter.properties" file within jakarta-jmeter-2.2/bin. Paging through that I found exactly what I was looking for:

# Timestamp format
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=MM/dd/yy HH:mm:ss

By uncommenting out the line "jmeter.save.saveservice.timestamp_format=MM/dd/yy HH:mm:ss", I was able to specify the month/day/year and hour format I wanted.

In theory, you could also do something like this from the command line (as described on the jmeter mailing list:

jmeter -n -t moodle.jmx -l moodlelog.jtl jmeter.save.saveservice.timestamp_format="yyyy-MM-dd HH:mm:ss"

But my Mac didn't want to evoke it from the command line. I'm sure I was doing something wrong, but being able to edit "jmeter.properties" solves my immediate problem, so I'm not to concerned about getting it to work.

Comments

Could you please post your moodle.jmx here as well? I would be interested to see your .jmx script. thanks!

Thanks for the great tip. Command line property passing requires "-J" prefix so your command line needs to be changed to


jmeter -Jjmeter.save.saveservice.timestamp_format="yyyy-MM-dd HH:mm:ss" -n -t moodle.jmx -l moodlelog.jtl

See Apache JMeter Properties Customization Guide for more information on various JMeter properties and ways of setting and overriding them