Search in sources :

Example 1 with VMStatsContract

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);
                    }
                }
            }
        }
    }
}
Also used : StatisticsType(org.apache.geode.StatisticsType) VMStatsContract(org.apache.geode.internal.statistics.VMStatsContract) Statistics(org.apache.geode.Statistics) LRUStatistics(org.apache.geode.internal.cache.lru.LRUStatistics) VMStats50(org.apache.geode.internal.stats50.VMStats50)

Example 2 with VMStatsContract

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);
    }
}
Also used : FunctionServiceStats(org.apache.geode.internal.cache.execute.FunctionServiceStats) CachePerfStats(org.apache.geode.internal.cache.CachePerfStats) MemberMBeanBridge(org.apache.geode.management.internal.beans.MemberMBeanBridge) VMStatsContract(org.apache.geode.internal.statistics.VMStatsContract) DLockStats(org.apache.geode.distributed.internal.locks.DLockStats) DiskStoreStats(org.apache.geode.internal.cache.DiskStoreStats) PartitionedRegionStats(org.apache.geode.internal.cache.PartitionedRegionStats) DistributionStats(org.apache.geode.distributed.internal.DistributionStats) VMStats50(org.apache.geode.internal.stats50.VMStats50)

Aggregations

VMStatsContract (org.apache.geode.internal.statistics.VMStatsContract)2 VMStats50 (org.apache.geode.internal.stats50.VMStats50)2 Statistics (org.apache.geode.Statistics)1 StatisticsType (org.apache.geode.StatisticsType)1 DistributionStats (org.apache.geode.distributed.internal.DistributionStats)1 DLockStats (org.apache.geode.distributed.internal.locks.DLockStats)1 CachePerfStats (org.apache.geode.internal.cache.CachePerfStats)1 DiskStoreStats (org.apache.geode.internal.cache.DiskStoreStats)1 PartitionedRegionStats (org.apache.geode.internal.cache.PartitionedRegionStats)1 FunctionServiceStats (org.apache.geode.internal.cache.execute.FunctionServiceStats)1 LRUStatistics (org.apache.geode.internal.cache.lru.LRUStatistics)1 MemberMBeanBridge (org.apache.geode.management.internal.beans.MemberMBeanBridge)1