/** * Collect samples of any operating system statistics * * @param prepareOnly * set to true if you only want to call prepareForSample */ private void sampleSpecialStats(boolean prepareOnly) { List<Statistics> statsList = getStatisticsManager().getStatsList(); synchronized (statsList) { for (Statistics s : statsList) { if (stopRequested()) return; if (s instanceof StatisticsImpl) { ((StatisticsImpl)s).prepareForSample(); } } } if (!prepareOnly && this.vmStats != null) { if (stopRequested()) return; this.vmStats.refresh(); } sampleProcessStats(prepareOnly); }
/** * Collect samples of any operating system statistics * * @param prepareOnly * set to true if you only want to call prepareForSample */ private void sampleSpecialStats(boolean prepareOnly) { List<Statistics> statsList = getStatisticsManager().getStatsList(); synchronized (statsList) { for (Statistics s : statsList) { if (stopRequested()) return; if (s instanceof StatisticsImpl) { ((StatisticsImpl)s).prepareForSample(); } } } if (!prepareOnly && this.vmStats != null) { if (stopRequested()) return; this.vmStats.refresh(); } sampleProcessStats(prepareOnly); }
remainingNanos = NanoTimer.millisToNanos(MIN_MS_SLEEP); while (remainingNanos > 0 && !stopRequested()) { long ms = NanoTimer.nanosToMillis(remainingNanos); if (ms <= 0) { if (stopRequested()) {
remainingNanos = NanoTimer.millisToNanos(MIN_MS_SLEEP); while (remainingNanos > 0 && !stopRequested()) { long ms = NanoTimer.nanosToMillis(remainingNanos); if (ms <= 0) { if (stopRequested()) {
while (!stopRequested()) { SystemFailure.checkFailure(); if (Thread.currentThread().isInterrupted()) { delay(timer, nanosToDelay); nanosLastTimeStamp = timer.getLastResetTime(); if (!stopRequested() && isSamplingEnabled()) { final long nanosTimeStamp = timer.getLastResetTime(); final long nanosElapsedSleeping = nanosTimeStamp - nanosBeforeSleep; checkElapsedSleepTime(nanosElapsedSleeping); if (stopRequested()) break; sampleSpecialStats(false); if (stopRequested()) break; checkListeners(); if (stopRequested()) break; } else if (!stopRequested() && !isSamplingEnabled()) { sampleSpecialStats(true); // fixes bug 42527
while (!stopRequested()) { SystemFailure.checkFailure(); if (Thread.currentThread().isInterrupted()) { delay(timer, nanosToDelay); nanosLastTimeStamp = timer.getLastResetTime(); if (!stopRequested() && isSamplingEnabled()) { final long nanosTimeStamp = timer.getLastResetTime(); final long nanosElapsedSleeping = nanosTimeStamp - nanosBeforeSleep; checkElapsedSleepTime(nanosElapsedSleeping); if (stopRequested()) break; prepareGFXDStats(false); if (stopRequested()) break; sampleSpecialStats(false); if (stopRequested()) break; checkListeners(); if (stopRequested()) break; } else if (!stopRequested() && !isSamplingEnabled()) { prepareGFXDStats(true); if (stopRequested()) break; sampleSpecialStats(true); // fixes bug 42527 diskMon.checkAvailableSpace(); if(!stopRequested()) { try { ProcessorKeeper21.cleanupProcessor();