/** * Returns a unique id for the sampler's system. */ @Override public final long getSystemId() { return getStatisticsManager().getId(); }
/** * Returns the number of times a statistics resource has been add or deleted. */ @Override public final int getStatisticsModCount() { return getStatisticsManager().getStatListModCount(); }
/** * Returns the time this sampler's system was started. */ @Override public final long getSystemStartTime() { return getStatisticsManager().getStartTime(); }
/** * Returns a unique id for the sampler's system. */ @Override public final long getSystemId() { return getStatisticsManager().getId(); }
/** * Returns the number of times a statistics resource has been add or deleted. */ @Override public final int getStatisticsModCount() { return getStatisticsManager().getStatListModCount(); }
/** * Returns an array of all the current statistic resource instances. */ @Override public final Statistics[] getStatistics() { return getStatisticsManager().getStatistics(); }
/** * Returns an array of all the current statistic resource instances. */ @Override public final Statistics[] getStatistics() { return getStatisticsManager().getStatistics(); }
/** * Returns the time this sampler's system was started. */ @Override public final long getSystemStartTime() { return getStatisticsManager().getStartTime(); }
protected long getSpecialStatsId() { return getStatisticsManager().getId(); }
protected long getSpecialStatsId() { return getStatisticsManager().getId(); }
/** * 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); }
/** * 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); }
/** * Initialize any special sampler stats */ private synchronized void initSpecialStats() { // add a vm resource long id = getSpecialStatsId(); this.vmStats = VMStatsContractFactory.create(getStatisticsManager(), id); initProcessStats(id); }
/** * Initialize any special sampler stats */ private synchronized void initSpecialStats() { // add a vm resource long id = getSpecialStatsId(); this.vmStats = new VMStats(getStatisticsManager(), id); initProcessStats(id); }
static RemoteStatListenerImpl create(int listenerId, InternalDistributedMember recipient, long resourceId, String statName, HostStatSampler sampler) { RemoteStatListenerImpl result = null; Statistics stats = sampler.getStatisticsManager().findStatistics(resourceId); StatisticDescriptorImpl stat = (StatisticDescriptorImpl)stats.nameToDescriptor(statName); switch (stat.getTypeCode()) { case StatisticDescriptorImpl.BYTE: case StatisticDescriptorImpl.SHORT: case StatisticDescriptorImpl.INT: case StatisticDescriptorImpl.LONG: result = new LongStatListenerImpl(); break; case StatisticDescriptorImpl.FLOAT: result = new FloatStatListenerImpl(); break; case StatisticDescriptorImpl.DOUBLE: result = new DoubleStatListenerImpl(); break; default: throw new RuntimeException(LocalizedStrings.GemFireStatSampler_ILLEGAL_FIELD_TYPE_0_FOR_STATISTIC.toLocalizedString(stats.getType())); } result.stats = stats; result.stat = stat; result.listenerId = listenerId; result.recipient = recipient; return result; }
/** * 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); }
static RemoteStatListenerImpl create(int listenerId, InternalDistributedMember recipient, long resourceId, String statName, HostStatSampler sampler) { RemoteStatListenerImpl result = null; Statistics stats = sampler.getStatisticsManager().findStatistics(resourceId); StatisticDescriptorImpl stat = (StatisticDescriptorImpl)stats.nameToDescriptor(statName); switch (stat.getTypeCode()) { case StatisticDescriptorImpl.BYTE: case StatisticDescriptorImpl.SHORT: case StatisticDescriptorImpl.INT: case StatisticDescriptorImpl.LONG: result = new LongStatListenerImpl(); break; case StatisticDescriptorImpl.FLOAT: result = new FloatStatListenerImpl(); break; case StatisticDescriptorImpl.DOUBLE: result = new DoubleStatListenerImpl(); break; default: throw new RuntimeException(LocalizedStrings.GemFireStatSampler_ILLEGAL_FIELD_TYPE_0_FOR_STATISTIC.toLocalizedString(stats.getType())); } result.stats = stats; result.stat = stat; result.listenerId = listenerId; result.recipient = recipient; return result; }