@Override public boolean waitForSample(long timeout) throws InterruptedException { final long endTime = System.currentTimeMillis() + timeout; final int startSampleCount = this.samplerStats.getSampleCount(); while (System.currentTimeMillis() < endTime && this.samplerStats.getSampleCount() <= startSampleCount) { Thread.sleep(WAIT_FOR_SLEEP_INTERVAL); } return this.samplerStats.getSampleCount() > startSampleCount; }
/** * Called when this sampler has spent some time working and wants * it to be accounted for. */ private void accountForTimeSpentWorking(long nanosSpentWorking, long nanosSpentSleeping) { this.samplerStats.tookSample( nanosSpentWorking, getStatisticsManager().getStatisticsCount(), nanosSpentSleeping); }
public GemFireStatSampler(InternalDistributedSystem con) { super(con.getCancelCriterion(), new StatSamplerStats(con, con.getId())); this.con = con; }
public void addSystemStats() { GemFireStatSampler sampler = system.getStatSampler(); ProcessStats processStats = sampler.getProcessStats(); StatSamplerStats samplerStats = sampler.getStatSamplerStats(); if (processStats != null) { systemStatsMonitor.addStatisticsToMonitor(processStats.getStatistics()); } if(samplerStats != null){ systemStatsMonitor.addStatisticsToMonitor(samplerStats.getStats()); } }
/** * Check the elapsed sleep time upon wakeup, and log a warning if it is longer than the delay * threshold. * * @param elapsedSleepTime duration of sleep in nanoseconds */ private void checkElapsedSleepTime(long elapsedSleepTime) { if (STAT_SAMPLER_DELAY_THRESHOLD > 0) { final long wakeupDelay = elapsedSleepTime - getNanoRate(); if (wakeupDelay > STAT_SAMPLER_DELAY_THRESHOLD_NANOS) { this.samplerStats.incJvmPauses(); logger.warn(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.HostStatSampler_STATISTICS_SAMPLING_THREAD_DETECTED_A_WAKEUP_DELAY_OF_0_MS_INDICATING_A_POSSIBLE_RESOURCE_ISSUE, NanoTimer.nanosToMillis(wakeupDelay))); } } } }
public SimpleStatSampler(CancelCriterion stopper, StatisticsManager sm) { super(stopper, new StatSamplerStats(sm, sm.getId())); this.sm = sm; logger.info(LogMarker.STATISTICS, LocalizedMessage.create(LocalizedStrings.SimpleStatSampler_STATSSAMPLERATE_0, getSampleRate())); }
public void addSystemStats() { GemFireStatSampler sampler = system.getStatSampler(); ProcessStats processStats = sampler.getProcessStats(); StatSamplerStats samplerStats = sampler.getStatSamplerStats(); if (processStats != null) { systemStatsMonitor.addStatisticsToMonitor(processStats.getStatistics()); } if(samplerStats != null){ systemStatsMonitor.addStatisticsToMonitor(samplerStats.getStats()); } }
/** * Check the elapsed sleep time upon wakeup, and log a warning if it is longer than the delay * threshold. * * @param elapsedSleepTime duration of sleep in nanoseconds */ private void checkElapsedSleepTime(long elapsedSleepTime) { if (STAT_SAMPLER_DELAY_THRESHOLD > 0) { final long wakeupDelay = elapsedSleepTime - getNanoRate(); if (wakeupDelay > STAT_SAMPLER_DELAY_THRESHOLD_NANOS) { this.samplerStats.incJvmPauses(); getLogger().warning(LocalizedStrings.HostStatSampler_STATISTICS_SAMPLING_THREAD_DETECTED_A_WAKEUP_DELAY_OF_0_MS_INDICATING_A_POSSIBLE_RESOURCE_ISSUE, NanoTimer.nanosToMillis(wakeupDelay)); } } }
public GemFireStatSampler(InternalDistributedSystem con) { super(con.getCancelCriterion(), con.getLogWriterI18n(), new StatSamplerStats(con, con.getId())); this.con = con; }
/** * Called when this sampler has spent some time working and wants * it to be accounted for. */ private void accountForTimeSpentWorking(long nanosSpentWorking, long nanosSpentSleeping) { this.samplerStats.tookSample( nanosSpentWorking, getStatisticsManager().getStatisticsCount(), nanosSpentSleeping); }
@Override public boolean waitForSample(long timeout) throws InterruptedException { final long endTime = System.currentTimeMillis() + timeout; final int startSampleCount = this.samplerStats.getSampleCount(); while (System.currentTimeMillis() < endTime && this.samplerStats.getSampleCount() <= startSampleCount) { Thread.sleep(WAIT_FOR_SLEEP_INTERVAL); } return this.samplerStats.getSampleCount() > startSampleCount; }
public SimpleStatSampler(CancelCriterion stopper, StatisticsManager sm) { super(stopper, sm.getLogWriterI18n(), new StatSamplerStats(sm, sm.getId())); this.sm = sm; sm.getLogWriterI18n().config(LocalizedStrings.SimpleStatSampler_STATSSAMPLERATE_0, getSampleRate()); }