use of org.apache.geode.internal.statistics.VMStatsContract in project geode by apache.
the class MemberMBeanBridge method addVMStats.
public void addVMStats() {
VMStatsContract vmStatsContract = system.getStatSampler().getVMStats();
if (vmStatsContract != null && vmStatsContract instanceof VMStats50) {
VMStats50 vmStats50 = (VMStats50) vmStatsContract;
Statistics vmStats = vmStats50.getVMStats();
if (vmStats != null) {
vmStatsMonitor.addStatisticsToMonitor(vmStats);
}
Statistics vmHeapStats = vmStats50.getVMHeapStats();
if (vmHeapStats != null) {
vmStatsMonitor.addStatisticsToMonitor(vmHeapStats);
}
StatisticsType gcType = VMStats50.getGCType();
if (gcType != null) {
Statistics[] gcStats = system.findStatisticsByType(gcType);
if (gcStats != null && gcStats.length > 0) {
for (Statistics gcStat : gcStats) {
if (gcStat != null) {
gcMonitor.addStatisticsToMonitor(gcStat);
}
}
}
}
}
}
use of org.apache.geode.internal.statistics.VMStatsContract in project geode by apache.
the class MemberLevelStatsJUnitTest method init.
public void init() {
cachePerfStats = new CachePerfStats(system);
funcServiceStats = new FunctionServiceStats(system, "FunctionExecution");
long statId = OSProcess.getId();
distributionStats = new DistributionStats(system, statId);
DistributionStats.enableClockStats = true;
dlockStats = new DLockStats(system, statId);
bridge = new MemberMBeanBridge();
bridge.addCacheStats(cachePerfStats);
bridge.addFunctionStats(funcServiceStats);
bridge.addDistributionStats(distributionStats);
bridge.addLockServiceStats(dlockStats);
VMStatsContract vmstats = system.getStatSampler().getVMStats();
assertTrue(vmstats instanceof VMStats50);
bridge.addSystemStats();
bridge.addVMStats();
for (int i = 0; i < 4; i++) {
DiskStoreStats stats = new DiskStoreStats(system, name.getMethodName() + i);
diskStatsList.add(stats);
bridge.addDiskStoreStats(stats);
}
for (int i = 0; i < 4; i++) {
PartitionedRegionStats stats = new PartitionedRegionStats(system, name.getMethodName() + i);
parRegionStatsList.add(stats);
bridge.addPartionRegionStats(stats);
}
}
Aggregations