Reputation: 1387
I cannot find a definition for any of these common Jenkins terms anywhere.
I also find it strange that in the metrics plugin https://wiki.jenkins.io/display/JENKINS/Metrics+Plugin all "jenkins.queue..." metrics seems to pertain to blocked state.
Upvotes: 2
Views: 3331
Reputation: 2631
To add to Mike's answer, I wanted to know how "too long" was defined for the jenkins.queue.stuck
metric. Here's the relevant part of the source code:
@Override
public boolean isStuck() {
Label label = getAssignedLabel();
if (label != null && label.isOffline())
// no executor online to process this job. definitely stuck.
return true;
long d = task.getEstimatedDuration();
long elapsed = System.currentTimeMillis() - buildableStartMilliseconds;
if (d >= 0) {
// if we were running elsewhere, we would have done this build ten times.
return elapsed > Math.max(d, 60000L) * 10;
} else {
// more than a day in the queue
return TimeUnit.MILLISECONDS.toHours(elapsed) > 24;
}
}
So, by my reading of the code, an item is stuck in the queue if:
Hope that helps someone else!
Upvotes: 0
Reputation: 615
Items in the queue go through several stages, as depicted below
(enter) --> waitingList --+--> blockedProjects
| ^
| |
| v
+--> buildables ---> pending ---> left
^ |
| |
+---(rarely)---+
jenkins.queue.blocked means that the number of jobs that are blocked by Jenkins. The cause of block can be anything from below
jenkins.queue.stuck means that the job is stuck in the queue even though all Node resources are available or there is an issue with the executor (if the job is starving for an executor for too long.).
jenkins.queue.pending means that the job is waiting for the next executor to run the job and all the node resources are health and reserved for the job.
jenkins.queue.buildable returns the total jobs which are in the buildable stage
Reference: javadoc.jenkins.io/hudson/model/Queue.html
Upvotes: 4