Exposed the pending provisioning requests to outside.

This commit is contained in:
Kohsuke Kawaguchi committed 2011-03-07 11:55:05 -08:00
1 parent e0b31e10e5
commit 2bba3bca45
1 file changed
+13 -1
@@ -34,6 +34,7 @@ import hudson.model.MultiStageTimeSeries.TimeScale;
import hudson.Extension;
import java.awt.Color;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import java.util.concurrent.ExecutionException;
import java.util.List;
@@ -84,7 +85,7 @@ public class NodeProvisioner {
*/
private final Label label;
private List<PlannedNode> pendingLaunches = new ArrayList<PlannedNode>();
private List<PlannedNode> pendingLaunches = new CopyOnWriteArrayList<PlannedNode>();
/**
* Exponential moving average of the "planned capacity" over time, which is the number of
@@ -101,6 +102,17 @@ public class NodeProvisioner {
this.stat = loadStatistics;
}
/**
* Nodes that are being launched.
*
* @return
* Can be empty but never null
* @since 1.401
*/
public List<PlannedNode> getPendingLaunches() {
return new ArrayList<PlannedNode>(pendingLaunches);
}
/**
* Periodically invoked to keep track of the load.
* Launches additional nodes if necessary.