How to check the size of the Bamboo build queue
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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:
1
2
$ BAMBOO_USER=example
$ curl -vvv --user $BAMBOO_USER http://localhost:8085/rest/api/latest/queue.json?expand=queuedBuilds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"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:
1
ls $BAMBOO_HOME/serverState/queue/ | wc -l
Was this helpful?