/** * Returns the estimated duration for the executable. * Protects against {@link AbstractMethodError}s if the {@link Executable} implementation * was compiled against Hudson < 1.383 * * @deprecated as of 1.388 * Use {@link Executables#getEstimatedDurationFor(Executable)} */ public static long getEstimatedDurationFor(Executable e) { return Executables.getEstimatedDurationFor(e); }
/** * Returns the estimated duration for the executable. * Protects against {@link AbstractMethodError}s if the {@link Executable} implementation * was compiled against Hudson < 1.383 * * @deprecated as of 1.388 * Use {@link Executables#getEstimatedDurationFor(Executable)} */ public static long getEstimatedDurationFor(Executable e) { return Executables.getEstimatedDurationFor(e); }
/** * Returns the estimated duration for the executable. * Protects against {@link AbstractMethodError}s if the {@link Executable} implementation * was compiled against Hudson < 1.383 * * @deprecated as of 1.388 * Use {@link Executables#getEstimatedDurationFor(Executable)} */ public static long getEstimatedDurationFor(Executable e) { return Executables.getEstimatedDurationFor(e); }
/** * Returns the estimated duration for the executable. Protects against * {@link AbstractMethodError}s if the {@link Executable} implementation was * compiled against Hudson < 1.383 * * * @deprecated as of 1.388 Use * {@link Executables#getEstimatedDurationFor(Executable)} */ public static long getEstimatedDurationFor(Executable e) { return Executables.getEstimatedDurationFor(e); } /**
/** * Returns when this executor started or should start being idle. */ public long getIdleStartMilliseconds() { Queue.Executable e = executable; if (e == null) { return Math.max(finishTime, owner.getConnectTime()); } else { return Math.max(startTime + Math.max(0, Executables.getEstimatedDurationFor(e)), System.currentTimeMillis() + 15000); } }
/** * Returns when this executor started or should start being idle. */ public long getIdleStartMilliseconds() { Queue.Executable e = executable; if (e == null) return Math.max(finishTime, owner.getConnectTime()); else { return Math.max(startTime + Math.max(0, Executables.getEstimatedDurationFor(e)), System.currentTimeMillis() + 15000); } }
/** * Returns when this executor started or should start being idle. */ public long getIdleStartMilliseconds() { Queue.Executable e = executable; if (e == null) return Math.max(finishTime, owner.getConnectTime()); else { return Math.max(startTime + Math.max(0, Executables.getEstimatedDurationFor(e)), System.currentTimeMillis() + 15000); } }
/** * The same as {@link #getEstimatedRemainingTime()} but return * it as a number of milli-seconds. */ public long getEstimatedRemainingTimeMillis() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; long eta = d-getElapsedTime(); if(eta<=0) return -1; return eta; }
/** * The same as {@link #getEstimatedRemainingTime()} but return * it as a number of milli-seconds. */ public long getEstimatedRemainingTimeMillis() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; long eta = d-getElapsedTime(); if(eta<=0) return -1; return eta; }
/** * Returns when this executor started or should start being idle. */ public long getIdleStartMilliseconds() { Queue.Executable e = executable; if (e == null) return Math.max(finishTime, owner.getConnectTime()); else { return Math.max(startTime + Math.max(0, Executables.getEstimatedDurationFor(e)), System.currentTimeMillis() + 15000); } }
/** * The same as {@link #getEstimatedRemainingTime()} but return * it as a number of milli-seconds. */ public long getEstimatedRemainingTimeMillis() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; long eta = d-getElapsedTime(); if(eta<=0) return -1; return eta; }
/** * Returns the progress of the current build in the number between 0-100. * * @return -1 * if it's impossible to estimate the progress. */ @Exported public int getProgress() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; int num = (int)(getElapsedTime()*100/d); if(num>=100) num=99; return num; }
/** * Returns the progress of the current build in the number between 0-100. * * @return -1 * if it's impossible to estimate the progress. */ @Exported public int getProgress() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; int num = (int)(getElapsedTime()*100/d); if(num>=100) num=99; return num; }
/** * Returns the progress of the current build in the number between 0-100. * * @return -1 * if it's impossible to estimate the progress. */ @Exported public int getProgress() { Queue.Executable e = executable; if(e==null) return -1; long d = Executables.getEstimatedDurationFor(e); if(d<0) return -1; int num = (int)(getElapsedTime()*100/d); if(num>=100) num=99; return num; }
/** * Returns true if the current build is likely stuck. * * <p> * This is a heuristics based approach, but if the build is suspiciously taking for a long time, * this method returns true. */ @Exported public boolean isLikelyStuck() { Queue.Executable e = executable; if(e==null) return false; long elapsed = getElapsedTime(); long d = Executables.getEstimatedDurationFor(e); if(d>=0) { // if it's taking 10 times longer than ETA, consider it stuck return d*10 < elapsed; } else { // if no ETA is available, a build taking longer than a day is considered stuck return TimeUnit2.MILLISECONDS.toHours(elapsed)>24; } }
/** * Returns true if the current build is likely stuck. * * <p> This is a heuristics based approach, but if the build is suspiciously * taking for a long time, this method returns true. */ @Exported public boolean isLikelyStuck() { Queue.Executable e = executable; if (e == null) { return false; } long elapsed = getElapsedTime(); long d = Executables.getEstimatedDurationFor(e); if (d >= 0) { // if it's taking 10 times longer than ETA, consider it stuck return d * 10 < elapsed; } else { // if no ETA is available, a build taking longer than a day is considered stuck return TimeUnit2.MILLISECONDS.toHours(elapsed) > 24; } }
/** * Computes a human-readable text that shows the expected remaining time * until the build completes. */ public String getEstimatedRemainingTime() { Queue.Executable e = executable; if(e==null) return Messages.Executor_NotAvailable(); long d = Executables.getEstimatedDurationFor(e); if(d<0) return Messages.Executor_NotAvailable(); long eta = d-getElapsedTime(); if(eta<=0) return Messages.Executor_NotAvailable(); return Util.getTimeSpanString(eta); }
/** * Computes a human-readable text that shows the expected remaining time * until the build completes. */ public String getEstimatedRemainingTime() { Queue.Executable e = executable; if(e==null) return Messages.Executor_NotAvailable(); long d = Executables.getEstimatedDurationFor(e); if(d<0) return Messages.Executor_NotAvailable(); long eta = d-getElapsedTime(); if(eta<=0) return Messages.Executor_NotAvailable(); return Util.getTimeSpanString(eta); }
/** * Computes a human-readable text that shows the expected remaining time * until the build completes. */ public String getEstimatedRemainingTime() { Queue.Executable e = executable; if(e==null) return Messages.Executor_NotAvailable(); long d = Executables.getEstimatedDurationFor(e); if(d<0) return Messages.Executor_NotAvailable(); long eta = d-getElapsedTime(); if(eta<=0) return Messages.Executor_NotAvailable(); return Util.getTimeSpanString(eta); }
/** * Computes a human-readable text that shows the expected remaining time * until the build completes. */ public String getEstimatedRemainingTime() { Queue.Executable e = executable; if (e == null) { return Messages.Executor_NotAvailable(); } long d = Executables.getEstimatedDurationFor(e); if (d < 0) { return Messages.Executor_NotAvailable(); } long eta = d - getElapsedTime(); if (eta <= 0) { return Messages.Executor_NotAvailable(); } return Util.getTimeSpanString(eta); }