@Override protected void doRun() { Jenkins j = Jenkins.get(); j.unlabeledNodeProvisioner.update(); for( Label l : j.getLabels() ) l.nodeProvisioner.update(); } }
public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Set<Label> labels = Jenkins.getInstance().getLabels(); List<String> queries = new AutoCompleteSeeder(value).getSeeds(); for (String term : queries) { for (Label l : labels) { if (l.getName().startsWith(term)) { c.add(l.getName()); } } } return c; }
protected void doRun() { Jenkins j = Jenkins.getInstance(); List<Queue.BuildableItem> bis = j.getQueue().getBuildableItems(); // update statistics on agents for( Label l : j.getLabels() ) { l.loadStatistics.updateCounts(l.loadStatistics.computeSnapshot(bis)); } // update statistics of the entire system j.unlabeledLoad.updateCounts(j.unlabeledLoad.computeSnapshot(bis)); j.overallLoad.updateCounts(j.overallLoad.computeSnapshot(bis)); }
@Override protected void doRun() { Jenkins h = Jenkins.getInstance(); h.unlabeledNodeProvisioner.update(); for( Label l : h.getLabels() ) l.nodeProvisioner.update(); } }
public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Jenkins j = Jenkins.getInstance(); if (j != null) { for (Label label : j.getLabels()) { if (label.getName().startsWith(value)) { c.add(label.getName()); } } } return c; }
@SuppressWarnings("unused") // used by stapler public ComboBoxModel doFillLabelItems() { ComboBoxModel cbm = new ComboBoxModel(); Set<Label> labels = Jenkins.getInstance().getLabels(); for (Label label : labels) { cbm.add(label.getDisplayName()); } return cbm; }
public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Set<Label> labels = Jenkins.getInstance().getLabels(); List<String> queries = new AutoCompleteSeeder(value).getSeeds(); for (String term : queries) { for (Label l : labels) { if (l.getName().startsWith(term)) { c.add(l.getName()); } } } return c; }
public AutoCompletionCandidates doAutoCompleteAssignedLabelString(@QueryParameter String value) { AutoCompletionCandidates c = new AutoCompletionCandidates(); Set<Label> labels = JenkinsHelper.getInstance().getLabels(); List<String> queries = new AutoCompleteSeeder(value).getSeeds(); for (String term : queries) { for (Label l : labels) { if (l.getName().startsWith(term)) { c.add(l.getName()); } } } return c; }
/** * Called by UI - Autocompletion for label values * * @param value the current value in the text field to base the automcompetion upon. * @return */ public AutoCompletionCandidates doAutoCompleteDefaultValue(@QueryParameter String value) { final AutoCompletionCandidates candidates = new AutoCompletionCandidates(); for (Label l : Jenkins.getInstance().getLabels()) { String label = l.getExpression(); if (StringUtils.containsIgnoreCase(label, value)) { candidates.add(label); } } return candidates; }
public void cleanCloudStatistics() { Jenkins jenkins = Jenkins.getInstance(); Set<ProvisioningActivity.Id> plannedNodesSet = new HashSet<>(); for (NodeProvisioner.PlannedNode node : jenkins.unlabeledNodeProvisioner.getPendingLaunches()) { if (node instanceof TrackedItem) { plannedNodesSet.add(((TrackedItem) node).getId()); } } for (Label l : jenkins.getLabels()) { for (NodeProvisioner.PlannedNode node : l.nodeProvisioner.getPendingLaunches()) { if (node instanceof TrackedItem) { plannedNodesSet.add(((TrackedItem) node).getId()); } } } for (Node node : jenkins.getNodes()) { if (node instanceof TrackedItem) { plannedNodesSet.add(((TrackedItem) node).getId()); } } Collection<ProvisioningActivity> activities = CloudStatistics.get().getNotCompletedActivities(); for (ProvisioningActivity activity : activities) { if (activity.getCurrentPhase().equals(ProvisioningActivity.Phase.PROVISIONING) && !plannedNodesSet.contains(activity.getId())) { Exception e = new Exception(String.format("Node %s has lost. Mark as failure", activity.getId().toString())); CloudStatistics.ProvisioningListener.get().onFailure(activity.getId(), e); } } }
protected void doRun() { Jenkins j = Jenkins.getInstance(); List<Queue.BuildableItem> bis = j.getQueue().getBuildableItems(); // update statistics on agents for( Label l : j.getLabels() ) { l.loadStatistics.updateCounts(l.loadStatistics.computeSnapshot(bis)); } // update statistics of the entire system j.unlabeledLoad.updateCounts(j.unlabeledLoad.computeSnapshot(bis)); j.overallLoad.updateCounts(j.overallLoad.computeSnapshot(bis)); }