diff --git a/changelog.html b/changelog.html index a4c4a9349e..ef152ab5f2 100644 --- a/changelog.html +++ b/changelog.html @@ -58,6 +58,9 @@ Upcoming changes
- * {@link #computeQueueLength()} and {@link #queueLength} counts those tasks
- * that are unassigned to any node, whereas {@link #totalQueueLength}
- * tracks the queue length including tasks that are assigned to a specific node.
+ * {@link LoadStatistics} for the entire system (the master and all the slaves combined),
+ * and all the jobs that are running on it.
*
* @author Kohsuke Kawaguchi
* @see Jenkins#overallLoad
+ * @see UnlabeldLoadStatistics
*/
public class OverallLoadStatistics extends LoadStatistics {
/**
* Number of total {@link Queue.BuildableItem}s that represents blocked builds.
+ *
+ * @deprecated as of 1.467
+ * Use {@link #queueLength}. Left as an alias here for backward compatibility.
*/
@Exported
- public final MultiStageTimeSeries totalQueueLength = new MultiStageTimeSeries(
- Messages._LoadStatistics_Legends_QueueLength(), ColorPalette.GREY, 0,DECAY);
+ @Restricted(NoExternalUse.class)
+ public final MultiStageTimeSeries totalQueueLength = queueLength;
public OverallLoadStatistics() {
super(0,0);
@@ -64,7 +66,7 @@ public class OverallLoadStatistics extends LoadStatistics {
@Override
public int computeQueueLength() {
- return Jenkins.getInstance().getQueue().countBuildableItemsFor(null);
+ return Jenkins.getInstance().getQueue().countBuildableItems();
}
/**
@@ -72,6 +74,6 @@ public class OverallLoadStatistics extends LoadStatistics {
* not {@link #queueLength}, which just shows jobs that are to be run on the master.
*/
protected TrendChart createOverallTrendChart(TimeScale timeScale) {
- return MultiStageTimeSeries.createTrendChart(timeScale,busyExecutors,totalExecutors,totalQueueLength);
+ return MultiStageTimeSeries.createTrendChart(timeScale,busyExecutors,totalExecutors,queueLength);
}
}
diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java
index 4d041a2d70..ee727dcf7a 100644
--- a/core/src/main/java/hudson/model/Queue.java
+++ b/core/src/main/java/hudson/model/Queue.java
@@ -691,6 +691,13 @@ public class Queue extends ResourceController implements Saveable {
return r;
}
+ /**
+ * Counts all the {@link BuildableItem}s currently in the queue.
+ */
+ public synchronized int countBuildableItems() {
+ return buildables.size()+pendings.size();
+ }
+
/**
* Gets the information about the queue item for the given project.
*
@@ -1260,6 +1267,14 @@ public class Queue extends ResourceController implements Saveable {
*/
public Future
+ * This code takes {@link LabelAssignmentAction} into account, then fall back to {@link SubTask#getAssignedLabel()}
+ */
public Label getAssignedLabel() {
for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) {
Label l = laa.getAssignedLabel(task);
diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java
index 0ad1519cff..c1b028cdb4 100644
--- a/core/src/main/java/hudson/slaves/NodeProvisioner.java
+++ b/core/src/main/java/hudson/slaves/NodeProvisioner.java
@@ -305,7 +305,7 @@ public class NodeProvisioner {
@Override
protected void doRun() {
Jenkins h = Jenkins.getInstance();
- h.overallNodeProvisioner.update();
+ h.unlabeledNodeProvisioner.update();
for( Label l : h.getLabels() )
l.nodeProvisioner.update();
}
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index 62c7978332..9c02c3c72d 100755
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -30,6 +30,7 @@ import com.google.common.collect.Lists;
import com.google.inject.Injector;
import hudson.ExtensionComponent;
import hudson.ExtensionFinder;
+import hudson.model.LoadStatistics;
import hudson.model.Messages;
import hudson.model.Node;
import hudson.model.AbstractCIBase;
@@ -569,14 +570,38 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup