How to Find how long a Build is Queued from the Logs
Purpose
If a Build is "stuck" queued and not seen to build for a long time, we may want to see how long it takes for the build to be sent to the agent and/or started
Solution
Add the following logging to Bamboo using the form at the top of
Administration >> Overview >> Log settings
:Classpath Type com.atlassian.bamboo.chains
DEBUG Run a new build, noting the build key
- Find the key for a Job that is queued – eg:
PROJ-PLAN-JOB-123
Run one of the following commands – based on your Operating System – on the Bamboo Server:
*nixegrep 'PROJ-PLAN-JOB-123' <bamboo-home>/logs/atlassian-bamboo.log | grep 'dispatched\|queued\|Sending\|onExecutionStartedTimingPoint'
Windowsfindstr <bamboo-home>\logs\atlassian-bamboo.log /c:'PROJ-PLAN-JOB-123' | findstr /rc:"dispatched" /c:"queued" /c:"Sending" /c:"onExecutionStartedTimingPoint"
The above commands will output the following:2017-11-10 11:14:16,199 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-10] [ChainExecutionManagerImpl] Build PROJ-PLAN-JOB-123 has been dispatched 2017-11-10 11:14:16,199 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-2] [ExecutionPhaseServiceImpl] Project - Plan - Job #123 (PROJ-PLAN-JOB-123) queued 2017-11-10 11:17:04,580 INFO [ActiveMQ Session Task-77807] [BuildQueueManagerImpl] Sending PROJ-PLAN-JOB-123 to agent 1234567890 2017-11-10 11:17:04,658 DEBUG [bambooAgentMessageListenerConnector-1] [ChainExecutionManagerImpl] onExecutionStartedTimingPoint for PROJ-PLAN-JOB-123
- Use the timestamps from the output of
grep
orfindstr
to find how long the Job was in each stage of dispatchingQueued:
11:17:04 - 11:14:16 2:48
Last modified on Nov 13, 2017
Powered by Confluence and Scroll Viewport.