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.