/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are being brought online. */ public int getIdleExecutors() { int r=0; for (Computer c : get_all()) if((c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) r += c.countIdle(); return r; }
@Override @GuardedBy("hudson.model.Queue.lock") public long check(T c) { if (!c.isConnecting() && c.isAcceptingTasks()) { if (isIdleForTooLong(c)) { try { Node n = c.getNode(); if (n!=null) // rare, but n==null if the node is deleted and being checked roughly at the same time kill(n); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to remove "+c.getDisplayName(),e); } } } return checkCycle(); }
public Builder with(@CheckForNull Computer computer) { if (computer == null) { return this; } if (computer.isOnline()) { final List<Executor> executors = computer.getExecutors(); final boolean acceptingTasks = computer.isAcceptingTasks(); for (Executor e : executors) { definedExecutors++; onlineExecutors++; if (e.getCurrentWorkUnit() != null) { busyExecutors++; } else { idleExecutors++; if (acceptingTasks) availableExecutors++; } } } else { final int numExecutors = computer.getNumExecutors(); definedExecutors += numExecutors; if (computer.isConnecting()) { connectingExecutors += numExecutors; } } return this; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r=0; for (Node n : getNodes()) { Computer c = n.toComputer(); if(c!=null && (c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) r += c.countIdle(); } return r; }
@Override public int computeIdleExecutors() { int r=0; for (Computer c : Jenkins.getInstance().getComputers()) { Node node = c.getNode(); if (node != null && node.getMode() == Mode.NORMAL && (c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) { r += c.countIdle(); } } return r; }
final HashMap<Computer, Integer> availableComputers = new HashMap<>(); for (Computer o : Jenkins.get().getComputers()) { if ((o.isOnline() || o.isConnecting()) && o.isPartiallyIdle() && o.isAcceptingTasks()) { final int idleExecutors = o.countIdle(); if (idleExecutors>0)
/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are being brought online. */ public int getIdleExecutors() { int r=0; for (Computer c : get_all()) if(c.isOnline() || c.isConnecting()) r += c.countIdle(); return r; }
/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are being brought online. */ public int getIdleExecutors() { int r=0; for (Computer c : get_all()) if(c.isOnline() || c.isConnecting()) r += c.countIdle(); return r; }
/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are being brought online. */ public int getIdleExecutors() { int r=0; for (Computer c : get_all()) if(c.isOnline() || c.isConnecting()) r += c.countIdle(); return r; }
/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are * being brought online. */ public int getIdleExecutors() { int r = 0; for (Computer c : get_all()) { if (c.isOnline() || c.isConnecting()) { r += c.countIdle(); } } return r; }
/** * {@code getTotalExecutors()-getBusyExecutors()}, plus executors that are being brought online. */ public int getIdleExecutors() { int r=0; for (Computer c : get_all()) if((c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) r += c.countIdle(); return r; }
@Override @GuardedBy("hudson.model.Queue.lock") public long check(T c) { if (!c.isConnecting() && c.isAcceptingTasks()) { if (isIdleForTooLong(c)) { try { Node n = c.getNode(); if (n!=null) // rare, but n==null if the node is deleted and being checked roughly at the same time kill(n); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to remove "+c.getDisplayName(),e); } } } return checkCycle(); }
public Builder with(@CheckForNull Computer computer) { if (computer == null) { return this; } if (computer.isOnline()) { final List<Executor> executors = computer.getExecutors(); final boolean acceptingTasks = computer.isAcceptingTasks(); for (Executor e : executors) { definedExecutors++; onlineExecutors++; if (e.getCurrentWorkUnit() != null) { busyExecutors++; } else { idleExecutors++; if (acceptingTasks) availableExecutors++; } } } else { final int numExecutors = computer.getNumExecutors(); definedExecutors += numExecutors; if (computer.isConnecting()) { connectingExecutors += numExecutors; } } return this; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r=0; for (Node n : getNodes()) { Computer c = n.toComputer(); if(c!=null && (c.isOnline() || c.isConnecting())) r += c.countIdle(); } return r; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r=0; for (Node n : getNodes()) { Computer c = n.toComputer(); if(c!=null && (c.isOnline() || c.isConnecting())) r += c.countIdle(); } return r; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r=0; for (Node n : getNodes()) { Computer c = n.toComputer(); if(c!=null && (c.isOnline() || c.isConnecting())) r += c.countIdle(); } return r; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r = 0; for (Node n : getNodes()) { Computer c = n.toComputer(); if (c != null && (c.isOnline() || c.isConnecting())) { r += c.countIdle(); } } return r; }
/** * Number of idle {@link Executor}s that can start working immediately. */ @Exported public int getIdleExecutors() { int r=0; for (Node n : getNodes()) { Computer c = n.toComputer(); if(c!=null && (c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) r += c.countIdle(); } return r; }
@Override public int computeIdleExecutors() { int r=0; for (Computer c : Jenkins.getInstance().getComputers()) { Node node = c.getNode(); if (node != null && node.getMode() == Mode.NORMAL && (c.isOnline() || c.isConnecting()) && c.isAcceptingTasks()) { r += c.countIdle(); } } return r; }
final HashMap<Computer, Integer> availableComputers = new HashMap<Computer, Integer>(); for (Computer o : Jenkins.getInstance().getComputers()) { if ((o.isOnline() || o.isConnecting()) && o.isPartiallyIdle() && o.isAcceptingTasks()) { final int idleExecutors = o.countIdle(); if (idleExecutors>0)