/** * Returns a human readable presentation of how long this item is already in the queue. * E.g. something like '3 minutes 40 seconds' */ public String getInQueueForString() { long duration = System.currentTimeMillis() - this.inQueueSince; return Util.getTimeSpanString(duration); }
/** * Human readable string of when this polling is started. */ public String getDuration() { return Util.getTimeSpanString(System.currentTimeMillis()-startTime); }
/** * Get a human readable string representing strings like "xxx days ago", * which should be used to point to the occurrence of an event in the past. */ @Nonnull public static String getPastTimeString(long duration) { return Messages.Util_pastTime(getTimeSpanString(duration)); }
/** * Returns a human-readable string representation of when this user was last active. */ public String getLastChangeTimeString() { if(lastChange==null) return "N/A"; long duration = new GregorianCalendar().getTimeInMillis()- ordinal(); return Util.getTimeSpanString(duration); }
public String getTimeSpanString() { return Util.getTimeSpanString(System.currentTimeMillis()-getLastModified()); }
/** * Gets the string that says how long the build took to run. */ public @Nonnull String getDurationString() { if (hasntStartedYet()) { return Messages.Run_NotStartedYet(); } else if (isBuilding()) { return Messages.Run_InProgressDuration( Util.getTimeSpanString(System.currentTimeMillis()-startTime)); } return Util.getTimeSpanString(duration); }
if (waitBetweenRetries != 0) { sb.append(" waiting "); sb.append(Util.getTimeSpanString(Math.abs(waitBetweenRetries))); if (waitBetweenRetries < 0) { sb.append("-"); sb.append(Util.getTimeSpanString(Math.abs(waitBetweenRetries) * (maxRetries + 1)));
public CauseOfBlockage getCauseOfBlockage() { long diff = timestamp.getTimeInMillis() - System.currentTimeMillis(); if (diff >= 0) return CauseOfBlockage.fromMessage(Messages._Queue_InQuietPeriod(Util.getTimeSpanString(diff))); else return CauseOfBlockage.fromMessage(Messages._Queue_FinishedWaiting()); }
/** * Gets the clock difference in HTML string. */ @Override public String toString() { if(-1000<diff && diff <1000) return Messages.ClockDifference_InSync(); // clock is in sync long abs = Math.abs(diff); String s = Util.getTimeSpanString(abs); if(diff<0) s = Messages.ClockDifference_Ahead(s); else s = Messages.ClockDifference_Behind(s); return s; }
private boolean runPolling() { try { // to make sure that the log file contains up-to-date text, // don't do buffering. StreamTaskListener listener = new StreamTaskListener(getLogFile()); try { PrintStream logger = listener.getLogger(); long start = System.currentTimeMillis(); logger.println("Started on "+ DateFormat.getDateTimeInstance().format(new Date())); boolean result = job().poll(listener).hasChanges(); logger.println("Done. Took "+ Util.getTimeSpanString(System.currentTimeMillis()-start)); if(result) logger.println("Changes found"); else logger.println("No changes"); return result; } catch (Error | RuntimeException e) { Functions.printStackTrace(e, listener.error("Failed to record SCM polling for " + job)); LOGGER.log(Level.SEVERE,"Failed to record SCM polling for "+job,e); throw e; } finally { listener.close(); } } catch (IOException e) { LOGGER.log(Level.SEVERE,"Failed to record SCM polling for "+job,e); return false; } }
/** * Computes a human-readable text that shows the expected remaining time * until the build completes. */ public String getEstimatedRemainingTime() { long d = executableEstimatedDuration; if (d < 0) { return Messages.Executor_NotAvailable(); } long eta = d - getElapsedTime(); if (eta <= 0) { return Messages.Executor_NotAvailable(); } return Util.getTimeSpanString(eta); }
LOGGER.log(Level.FINE, "Directory {0} is only {1} old, so not deleting", new Object[] {dir, Util.getTimeSpanString(now-dir.lastModified())}); return false;
new Object[]{c.getName(), Util.getTimeSpanString(demandMilliseconds)}); c.connect(false); new Object[]{c.getName(), Util.getTimeSpanString(idleMilliseconds)}); c.disconnect(new OfflineCause.IdleOfflineCause()); } else {
/** * Human readable string of when this polling is started. */ public String getDuration() { return Util.getTimeSpanString(System.currentTimeMillis()-startTime); }
/** * Returns a human readable presentation of how long this item is already in the queue. * E.g. something like '3 minutes 40 seconds' */ public String getInQueueForString() { long duration = System.currentTimeMillis() - this.inQueueSince; return Util.getTimeSpanString(duration); }
/** * Returns a human-readable string representation of when this user was last active. */ public String getLastChangeTimeString() { if(lastChange==null) return "N/A"; long duration = new GregorianCalendar().getTimeInMillis()- ordinal(); return Util.getTimeSpanString(duration); }
/** * Get a human readable string representing strings like "xxx days ago", * which should be used to point to the occurrence of an event in the past. */ @Nonnull public static String getPastTimeString(long duration) { return Messages.Util_pastTime(getTimeSpanString(duration)); }
/** * Returns a human-readable string representation of when this user was last active. */ public String getLastChangeTimeString() { if(lastChange==null) return "N/A"; long duration = new GregorianCalendar().getTimeInMillis()- ordinal(); return Util.getTimeSpanString(duration); }
/** * Gets the string that says how long the build took to run. */ public @Nonnull String getDurationString() { if (hasntStartedYet()) { return Messages.Run_NotStartedYet(); } else if (isBuilding()) { return Messages.Run_InProgressDuration( Util.getTimeSpanString(System.currentTimeMillis()-startTime)); } return Util.getTimeSpanString(duration); }
/** * How long ago this will remain disabled by the system, e.g. "2 min 0 sec". */ public String getWhenReEnableBySystemString() { final long now = readTimeNowInNanoseconds(); if (!getDisabledBySystem()) { return ""; } final long howSoonInNanoseconds = nanotimeWhenReEnableBySystem - now; final long howSoonInMilliseconds = TimeUnit.NANOSECONDS.toMillis(howSoonInNanoseconds); return Util.getTimeSpanString(howSoonInMilliseconds); }