/** * Returns the number of times a statistics resource has been add or deleted. */ @Override public int getStatisticsModCount() { return getStatisticsManager().getStatListModCount(); }
/** * Returns an array of all the current statistic resource instances. */ @Override public Statistics[] getStatistics() { return getStatisticsManager().getStatistics(); }
/** * Returns the time this sampler's system was started. */ @Override public long getSystemStartTime() { return getStatisticsManager().getStartTime(); }
/** * 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); }
this.callbackSampler.start(getStatisticsManager(), getSampleRate(), TimeUnit.MILLISECONDS); statThread = new LoggingThread("StatSampler", this); statThread.setPriority(Thread.MAX_PRIORITY);
/** * Initialize any special sampler stats */ private synchronized void initSpecialStats() { // add a vm resource long id = getSystemId(); this.vmStats = VMStatsContractFactory.create(getStatisticsManager(), id); initProcessStats(id); }
static RemoteStatListenerImpl create(int listenerId, InternalDistributedMember recipient, long resourceId, String statName, HostStatSampler sampler) { RemoteStatListenerImpl result = null; Statistics stats = sampler.getStatisticsManager().findStatisticsByUniqueId(resourceId); if (stats == null) { throw new RuntimeException(
/** * 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(); 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); }