javamesosmesos-chronos

Mesos Task Status Timestamp


I am just trying to understand the timestamp field in Mesos statuses.

The Mesos tasks can be listed using the URL,

http://<HOST_NAME>:5050/tasks and the tasks are returned as follows.

{
  "id":"task_id:",
  "name":"name",
  "state":"TASK_FAILED",
  "statuses":[
    {
      "state":"TASK_FAILED",
      "timestamp":1507589419.3334
    }
  ]
}

Here, the timestamp is "timestamp": 1507589419.3334 is in decimal format.

I just convert this to DateTime using the below code.

double myDouble = Double.parseDouble("1507589419.3334");
    long myLong = (long) (myDouble*1000);
    System.out.println(new DateTime(myLong));

Is this correct? What is this format?

Also, The job was scheduled thru Chronos and Job has a timestamp. How to understand the timezone from here?

Thanks


Solution

  • The timestamp in Unix Epoch time.

    I don't think Parse Double will do it. I looks like you are using Java, so you want something like this: convert epoch time to date

    The decimal points is just more granularity after seconds (milliseconds, nanoseconds, etc). If you go to this website: https://www.epochconverter.com/, you can see that 1507589419.3334 is GMT: Monday, October 9, 2017 10:50:19.333 PM

    Hope this helps.