How can the size of the Bamboo build queue be checked?

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Summary

The Bamboo queue size varies depending on the amount of jobs and deployment environments are in the build queue at any point in time. It may be necessary to monitor the size of the queue to understand if there are enough build agents to service the amount of builds and deployments that are being queued throughout the day.

Solution

There are a few methods to check the Bamboo build queue.

Solution #1

You can view the Bamboo build queue and currently building jobs in the application at Build > Build Activity. 

Solution #2

You can monitor the Bamboo build queue via REST API using the /queue resource:

Within the queuedBuilds element there is a size attribute which totals the amount of jobs in the queue.

Example:

$ BAMBOO_USER=example
$ curl -vvv --user $BAMBOO_USER http://localhost:8085/rest/api/latest/queue.json?expand=queuedBuilds
Response
{
   "expand":"queuedBuilds",
   "link":{
      "href":"http://localhost:8085/rest/api/latest/queue",
      "rel":"self"
   },
   "queuedBuilds":{
      "size":4,
      "expand":"queuedBuild",
      "queuedBuild":[
         {
            "planKey":"BAM-HANG-JOB1",
            "buildNumber":4,
            "buildResultKey":"BAM-HANG-JOB1-4",
            "triggerReason":"Manual build",
            "link":{
               "href":"http://localhost:8085/rest/api/latest/result/BAM-HANG-JOB1-4",
               "rel":"self"
            }
         },
         {
            "planKey":"BAM-HANG-JOB1",
            "buildNumber":5,
            "buildResultKey":"BAM-HANG-JOB1-5",
            "triggerReason":"Manual build",
            "link":{
               "href":"http://localhost:8085/rest/api/latest/result/BAM-HANG-JOB1-5",
               "rel":"self"
            }
         },
         {
            "planKey":"DEP-PARENT-JOB1",
            "buildNumber":5855,
            "buildResultKey":"DEP-PARENT-JOB1-5855",
            "triggerReason":"Scheduled build",
            "link":{
               "href":"http://localhost:8085/rest/api/latest/result/DEP-PARENT-JOB1-5855",
               "rel":"self"
            }
         },
         {
            "planKey":"DEP-PARENT-JOB1",
            "buildNumber":5856,
            "buildResultKey":"DEP-PARENT-JOB1-5856",
            "triggerReason":"Scheduled build",
            "link":{
               "href":"http://localhost:8085/rest/api/latest/result/DEP-PARENT-JOB1-5856",
               "rel":"self"
            }
         }
      ],
      "start-index":0,
      "max-result":4
   }
}
Solution #3

Monitor via the filesystem by counting the amount of files in the queue directory, of which there is one file per job:

ls $BAMBOO_HOME/serverState/queue/ | wc -l



Last modified on May 25, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.