LAGUREN.NET
  • HOME
  • About Me

Converting JMeter Timestamp

2/10/2017

 
Sometimes, I forget to configure JMeter so that the timestamps in the JTL are human readable.  Instead, I could end up with a results file that looks like this:

timeStamp,elapsed,label,responseCode,responseMessage, ...
1486489879434,211,HTTP Request,204,No Content,...

The timestamp displayed is in "epoch" time.  The only caveat is that this timestamp is in milliseconds.  So, in order to convert it you would need to do the following:
  1. Divide the time stamp to get the time in seconds
  2. Divide by the total number of seconds ind a day (60 * 60 *24)
  3. Add to the number of days since January 1, 1970

Luckily, many programming languages have a library that handle that.  In the case of ruby, 

require 'date'

​timestamp = 1486489879434
puts Time.at(timestamp/1000)

which returns '2017-02-07 09:51:18 -0800'

Comments are closed.

    RSS Feed

    Categories

    All
    Advice
    Agile
    Android
    Automation
    BDD
    C9D9
    Capybara
    Career
    Continuous Delivery
    Continuous Integration
    Cucumber
    Database
    Ebates
    Firefox
    Fiverr
    GIT
    Groupon
    Interview
    Investing
    Jenkins
    JIRA
    Jmeter
    Jobs
    Meetup
    Melvinisms
    Metaprogramming
    Mobile
    Ruby
    Stockpile
    Training

© COPYRIGHT 2018. ALL RIGHTS RESERVED.
  • HOME
  • About Me