Search in sources :

Example 1 with PartitionedRegionStats

use of org.apache.geode.internal.cache.PartitionedRegionStats in project geode by apache.

the class MemberLevelStatsJUnitTest method testRegionCounters.

@Test
public void testRegionCounters() throws InterruptedException {
    for (PartitionedRegionStats stats : parRegionStatsList) {
        stats.incBucketCount(1);
        stats.incPrimaryBucketCount(1);
        stats.incDataStoreEntryCount(1);
    }
    sample();
    assertEquals(4, getTotalBucketCount());
    assertEquals(4, getTotalBucketSize());
    assertEquals(4, getTotalPrimaryBucketCount());
    for (PartitionedRegionStats stats : parRegionStatsList) {
        bridge.removePartionRegionStats(stats);
        stats.close();
    }
    sample();
    assertEquals(0, getTotalBucketCount());
    assertEquals(0, getTotalBucketSize());
    assertEquals(0, getTotalPrimaryBucketCount());
}
Also used : PartitionedRegionStats(org.apache.geode.internal.cache.PartitionedRegionStats) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 2 with PartitionedRegionStats

use of org.apache.geode.internal.cache.PartitionedRegionStats in project geode by apache.

the class RegionStatsJUnitTest method init.

protected void init() {
    cachePerfStats = new CachePerfStats(system);
    partitionedRegionStats = new PartitionedRegionStats(system, "/tests");
    diskRegionStats = new DiskRegionStats(system, "test-disk");
    bridge = new RegionMBeanBridge(cachePerfStats);
    parBridge = new PartitionedRegionBridge(partitionedRegionStats);
    diskBridge = new DiskRegionBridge(diskRegionStats);
}
Also used : DiskRegionBridge(org.apache.geode.management.internal.beans.DiskRegionBridge) DiskRegionStats(org.apache.geode.internal.cache.DiskRegionStats) PartitionedRegionBridge(org.apache.geode.management.internal.beans.PartitionedRegionBridge) CachePerfStats(org.apache.geode.internal.cache.CachePerfStats) RegionMBeanBridge(org.apache.geode.management.internal.beans.RegionMBeanBridge) PartitionedRegionStats(org.apache.geode.internal.cache.PartitionedRegionStats)

Example 3 with PartitionedRegionStats

use of org.apache.geode.internal.cache.PartitionedRegionStats 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

PartitionedRegionStats (org.apache.geode.internal.cache.PartitionedRegionStats)3 CachePerfStats (org.apache.geode.internal.cache.CachePerfStats)2 DistributionStats (org.apache.geode.distributed.internal.DistributionStats)1 DLockStats (org.apache.geode.distributed.internal.locks.DLockStats)1 DiskRegionStats (org.apache.geode.internal.cache.DiskRegionStats)1 DiskStoreStats (org.apache.geode.internal.cache.DiskStoreStats)1 FunctionServiceStats (org.apache.geode.internal.cache.execute.FunctionServiceStats)1 VMStatsContract (org.apache.geode.internal.statistics.VMStatsContract)1 VMStats50 (org.apache.geode.internal.stats50.VMStats50)1 DiskRegionBridge (org.apache.geode.management.internal.beans.DiskRegionBridge)1 MemberMBeanBridge (org.apache.geode.management.internal.beans.MemberMBeanBridge)1 PartitionedRegionBridge (org.apache.geode.management.internal.beans.PartitionedRegionBridge)1 RegionMBeanBridge (org.apache.geode.management.internal.beans.RegionMBeanBridge)1 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)1 Test (org.junit.Test)1