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:
- one of:
However, I’ve noticed that frequently
scheduledAt are the same, and frequently
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?
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
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
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
Thanks! That really helps clear things up (I never noticed that little blurb at the bottom of that page).