/** * get total. * * @return total */ public long getTotal() { return total.longValue(); }
/** * get total. * * @return total */ public long getTotal() { return total.longValue(); }
public long getSpilledBytes() { return spilledBytes.longValue(); }
@Override public long getNumberOfActiveReadTransactions() { return activeReadTransactionCount.longValue(); }
public long getOutstandingRequests() { return outstandingCount.longValue(); }
public long getPacketsReceived() { return packetsReceived.longValue(); }
public long getPacketsSent() { return packetsSent.longValue(); }
/** * Gets the reference of the current mob file. * Internal usage, currently it's for testing. * @return The reference of the current mob file. */ public long getReferenceCount() { return this.referenceCount.longValue(); } }
/** * Get the number of bytes read since creation or since last resetBytesRead() call. * * @return The number of bytes read * @see MonitoredBufferedInputStream#resetBytesRead */ public long getBytesRead() { return bytesRead.longValue(); }
@VisibleForTesting long getLevelScheduledTime(int level) { return levelScheduledTime[level].longValue(); }
public SerializedForm(Result result) { fCount = result.count; fIgnoreCount = result.ignoreCount; assumptionFailureCount = result.assumptionFailureCount; fFailures = Collections.synchronizedList(new ArrayList<Failure>(result.failures)); fRunTime = result.runTime.longValue(); fStartTime = result.startTime.longValue(); }
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final DataVersion that = (DataVersion) o; if (timestamp != that.timestamp) { return false; } if (counter != null && that.counter != null) { return counter.longValue() == that.counter.longValue(); } return (null == counter) && (null == that.counter); }
@Override public JSONObject createContent() { if (requestsByLanguage.size() == 0) { return null; } Map<String, AtomicLong> currentRequests = new TreeMap<>(requestsByLanguage); requestsByLanguage.clear(); JSONObject payload = new JSONObject(); for (Map.Entry<String, AtomicLong> entry : currentRequests.entrySet()) { payload.put(entry.getKey(), entry.getValue().longValue()); } return payload; }
public static boolean isThreadWaiting(Thread t) { if (!SIMULATING.get()) { throw new IllegalStateException("Must be in simulation mode"); } AtomicLong time = THREAD_SLEEP_TIMES_NANOS.get(t); return !t.isAlive() || time != null && nanoTime() < time.longValue(); }
private void updateCounters(final long increment) { final long newValue = bytesRead.addAndGet(increment); final long nextBound = firstPercentBound.longValue(); if ((newValue > nextBound) && (nextBound != 0L)) { final int percentage = Math.min(100, (int)Math.floor(100 * newValue/contentLength)); percentRead.set(percentage); // to next percentage value firstPercentBound.set((1 + percentRead.get()) * contentLength/100); propertyChangeSupport.firePropertyChange(PROGRESS, -1, percentage); } }
public static boolean isThreadWaiting(Thread t) { if (!simulating.get()) throw new IllegalStateException("Must be in simulation mode"); AtomicLong time; synchronized (sleepTimesLock) { time = threadSleepTimes.get(t); } return !t.isAlive() || time != null && currentTimeMillis() < time.longValue(); } }
/** {@inheritDoc} */ @Override public Map<Integer, Long> cacheSizes() { if (!grp.sharedGroup()) return null; Map<Integer, Long> res = new HashMap<>(); for (Map.Entry<Integer, AtomicLong> e : cacheSizes.entrySet()) res.put(e.getKey(), e.getValue().longValue()); return res; }
@JmxGetter(name = "numEnvironmentFailureExceptions") public long getNumEnvironmentFailureExceptions() { return numEnvironmentFailureExceptions.longValue(); }
/** * Persists the queue contents to the disk. */ public void save() { if(BulkChange.contains(this)) return; if (Jenkins.getInstanceOrNull() == null) { return; } XmlFile queueFile = new XmlFile(XSTREAM, getXMLQueueFile()); lock.lock(); try { // write out the queue state we want to save State state = new State(); state.counter = WaitingItem.COUNTER.longValue(); // write out the tasks on the queue for (Item item: getItems()) { if(item.task instanceof TransientTask) continue; state.items.add(item); } try { queueFile.write(state); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to write out the queue file " + getXMLQueueFile(), e); } } finally { lock.unlock(); } SaveableListener.fireOnChange(this, queueFile); }