public long getOffHeapCompactionTime() { long compactionTime = 0; OffHeapMemoryStats stats = getOffHeapStats(); if(null != stats) { compactionTime = stats.getCompactionTime(); } return compactionTime; }
public long getOffHeapCompactionTime() { long compactionTime = 0; OffHeapMemoryStats stats = getOffHeapStats(); if(null != stats) { compactionTime = stats.getCompactionTime(); } return compactionTime; }
/** Verify that compaction occurred and its count is one more than the previous stat value. * * @param stats The off-heap memory stats to use to check for compaction. * @param previousNumCompactions The expected number of compactions should be greater than this number. */ private static void verifyCompaction(OffHeapMemoryStats stats, long previousNumCompactions) { long compactions = stats.getCompactions(); long compactionTime = stats.getCompactionTime(); Log.getLogWriter().info("Compactions (from stats): " + compactions); Log.getLogWriter().info("Compaction time (from stats): " + compactionTime); if (compactions <= previousNumCompactions) { throw new TestException("Expected compactions stat to be " + previousNumCompactions + ", but it is " + compactions); } if (compactionTime <= 0) { throw new TestException("Expected compactionTime stat to be > 0, but it is " + compactionTime); } }
@Override public void initialize(OffHeapMemoryStats oldStats) { setFreeMemory(oldStats.getFreeMemory()); setMaxMemory(oldStats.getMaxMemory()); setUsedMemory(oldStats.getUsedMemory()); setObjects(oldStats.getObjects()); setReads(oldStats.getReads()); setCompactions(oldStats.getCompactions()); setFragments(oldStats.getFragments()); setLargestFragment(oldStats.getLargestFragment()); setCompactionTime(oldStats.getCompactionTime()); setFragmentation(oldStats.getFragmentation()); oldStats.close(); }
@Override public void initialize(OffHeapMemoryStats oldStats) { setFreeMemory(oldStats.getFreeMemory()); setMaxMemory(oldStats.getMaxMemory()); setUsedMemory(oldStats.getUsedMemory()); setObjects(oldStats.getObjects()); setReads(oldStats.getReads()); setCompactions(oldStats.getCompactions()); setFragments(oldStats.getFragments()); setLargestFragment(oldStats.getLargestFragment()); setCompactionTime(oldStats.getCompactionTime()); setFragmentation(oldStats.getFragmentation()); oldStats.close(); }