What is the order of timestamps for job execution?

I’ve been looking at the time-related metrics for various jobs and am confused as to their ordering.

Looking at the GraphQL API documentation for JobTypeCommand, I assumed that the timestamps would be ordered from earliest to latest like so:

  • createdAt
  • scheduledAt
  • runnableAt
  • startedAt
  • one of: canceledAt, expiredAt, finishedAt

However, I’ve noticed that frequently createdAt and scheduledAt are the same, and frequently scheduledAt precedes createdAt by more than 30 seconds. Additionally, when jobs are re-run createdAt appears to be updated, but scheduledAt remains the same as the original job.

Am I misunderstanding what these timestamps represent? If so, what order should these timestamps be in? Alternatively, could there be something wrong with the way we’re creating jobs?

Hey @eleanor-forum

Thanks for reaching out!

No you aren’t misunderstanding this, we do have a reference to this in our documentation under the scheduled_at timestamp for the jobs

For most of my jobs, the created_at and scheduled_at are the same value, just like you said. But there are some scenarios where I noticed the scheduled_at was earlier than the created_at.

  • scheduled_at : Timestamp indicates when the job was scheduled to run
  • created_at: The time when the job was created or added to the build

For example when a job fails and Its retried, the retry has a later timestamp for created_at. The concept is that with retries, the scheduled_at maintains the timestamp for when the original job was scheduled, but the created_at will be the time when you actually retried the job.

Hope this helps
Cheers!

Thanks! That really helps clear things up (I never noticed that little blurb at the bottom of that page).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.