If jobs in your pipeline are taking a while to run or stuck in the running
state and you're unsure why, you can check the Usage Queue to determine if that job is queued behind other running jobs.
https://circleci.com/api/v1.1/project/github/{orgname}/{project}/{CIRCLE_BUILD_NUM}
orgname
is name of the organization or username
project
is the name of your repository
CIRCLE_BUILD_NUM
the built-in environment variable associated with the specific build in question, which can be found in the UI
If the build was put in the usage queue, you will see the usage_queued_at
key and the time it was queued at (UTC), example:
"usage_queued_at"
: "2020-08-17T17:40:53.115Z"
You can then use the following endpoint to view which jobs were queued prior to this build:
https://circleci.com/api/v1.1/project/github/{orgname}/{project}/{CIRCLE_BUILD_NUM}/usage-queue
For those on the Performance Plan getting stuck in the Usage Queue, you can request a concurrency increase by writing to billing@circleci.com.
Comments
Please sign in to leave a comment.