Search in sources :

Example 1 with OffHeapMemoryStats

use of org.apache.geode.internal.offheap.OffHeapMemoryStats in project geode by apache.

the class MemberMBeanBridge method getOffHeapCompactionTime.

public long getOffHeapCompactionTime() {
    long compactionTime = 0;
    OffHeapMemoryStats stats = getOffHeapStats();
    if (null != stats) {
        compactionTime = stats.getDefragmentationTime();
    }
    return compactionTime;
}
Also used : OffHeapMemoryStats(org.apache.geode.internal.offheap.OffHeapMemoryStats)

Example 2 with OffHeapMemoryStats

use of org.apache.geode.internal.offheap.OffHeapMemoryStats in project geode by apache.

the class MemberMBeanBridge method getOffHeapStats.

/**
   * Returns the OffHeapMemoryStats for this VM.
   */
private OffHeapMemoryStats getOffHeapStats() {
    OffHeapMemoryStats stats = null;
    MemoryAllocator offHeap = this.cache.getOffHeapStore();
    if (null != offHeap) {
        stats = offHeap.getStats();
    }
    return stats;
}
Also used : MemoryAllocator(org.apache.geode.internal.offheap.MemoryAllocator) OffHeapMemoryStats(org.apache.geode.internal.offheap.OffHeapMemoryStats)

Example 3 with OffHeapMemoryStats

use of org.apache.geode.internal.offheap.OffHeapMemoryStats in project geode by apache.

the class MemberMBeanBridge method getOffHeapUsedMemory.

public long getOffHeapUsedMemory() {
    long usedSize = 0;
    OffHeapMemoryStats stats = getOffHeapStats();
    if (null != stats) {
        usedSize = stats.getUsedMemory();
    }
    return usedSize;
}
Also used : OffHeapMemoryStats(org.apache.geode.internal.offheap.OffHeapMemoryStats)

Example 4 with OffHeapMemoryStats

use of org.apache.geode.internal.offheap.OffHeapMemoryStats in project geode by apache.

the class MemberMBeanBridge method getOffHeapMaxMemory.

public long getOffHeapMaxMemory() {
    long usedSize = 0;
    OffHeapMemoryStats stats = getOffHeapStats();
    if (null != stats) {
        usedSize = stats.getMaxMemory();
    }
    return usedSize;
}
Also used : OffHeapMemoryStats(org.apache.geode.internal.offheap.OffHeapMemoryStats)

Example 5 with OffHeapMemoryStats

use of org.apache.geode.internal.offheap.OffHeapMemoryStats in project geode by apache.

the class MemberMBeanBridge method init.

public MemberMBeanBridge init() {
    CachePerfStats cachePerfStats = this.cache.getCachePerfStats();
    addCacheStats(cachePerfStats);
    addFunctionStats(system.getFunctionServiceStats());
    if (system.getDistributionManager().getStats() instanceof DistributionStats) {
        DistributionStats distributionStats = (DistributionStats) system.getDistributionManager().getStats();
        addDistributionStats(distributionStats);
    }
    if (PureJavaMode.osStatsAreAvailable()) {
        Statistics[] systemStats = null;
        if (HostStatHelper.isSolaris()) {
            systemStats = system.findStatisticsByType(SolarisSystemStats.getType());
        } else if (HostStatHelper.isLinux()) {
            systemStats = system.findStatisticsByType(LinuxSystemStats.getType());
        } else if (HostStatHelper.isOSX()) {
            // @TODO once OSX stats are implemented
            systemStats = null;
        } else if (HostStatHelper.isWindows()) {
            systemStats = system.findStatisticsByType(WindowsSystemStats.getType());
        }
        if (systemStats != null) {
            systemStat = systemStats[0];
        }
    }
    MemoryAllocator allocator = this.cache.getOffHeapStore();
    if ((null != allocator)) {
        OffHeapMemoryStats offHeapStats = allocator.getStats();
        if (null != offHeapStats) {
            addOffHeapStats(offHeapStats);
        }
    }
    addSystemStats();
    addVMStats();
    initializeStats();
    return this;
}
Also used : MemoryAllocator(org.apache.geode.internal.offheap.MemoryAllocator) OffHeapMemoryStats(org.apache.geode.internal.offheap.OffHeapMemoryStats) CachePerfStats(org.apache.geode.internal.cache.CachePerfStats) Statistics(org.apache.geode.Statistics) LRUStatistics(org.apache.geode.internal.cache.lru.LRUStatistics) DistributionStats(org.apache.geode.distributed.internal.DistributionStats)

Aggregations

OffHeapMemoryStats (org.apache.geode.internal.offheap.OffHeapMemoryStats)8 MemoryAllocator (org.apache.geode.internal.offheap.MemoryAllocator)2 Statistics (org.apache.geode.Statistics)1 DistributionStats (org.apache.geode.distributed.internal.DistributionStats)1 CachePerfStats (org.apache.geode.internal.cache.CachePerfStats)1 LRUStatistics (org.apache.geode.internal.cache.lru.LRUStatistics)1