INNER CODE UNIT · Java
availableCapacity
jenkinsci/kubernetes-plugin · src/main/java/io/jenkins/plugins/kubernetes/NoDelayProvisionerStrategy.java:49
int availableCapacity = snapshot.getAvailableExecutors() // live executors
+ snapshot.getConnectingExecutors() // executors present but not yet connected
+ strategyState
.getPlannedCapacitySnapshot() // capacity added by previous strategies from previous rounds
+ strategyState.getAdditionalPlannedCapacity(); // capacity added by previous strategies _this round_
int previousCapacity = availableCapacity;
int currentDemand = snapshot.getQueueLength();
LOGGER.log(
Level.FINE, "Available capacity={0}, currentDemand={1}", new Object[] {availableCapacity, currentDemand
});
if (availableCapacity < currentDemand) {
List<Cloud> jenkinsClouds = new ArrayList<>(Jenkins.get().clouds);
if (!DISABLE_CLOUD_SHUFFLE) {
Collections.shuffle(jenkinsClouds);
}
Cloud.CloudState cloudState = new Cloud.CloudState(label, strategyState.getAdditionalPlannedCapacity());