public LocalStatisticsFactory(CancelCriterion stopper) { super(initId(), initName(), initStartTime()); this.statsDisabled = Boolean.getBoolean(STATS_DISABLE_NAME_PROPERTY); if (statsDisabled) { this.sampler = null; logger.info(LogMarker.STATISTICS_MARKER, "Statistic collection is disabled: use: -Dstats.disable=false to turn on statistics."); } else if (stopper != null) { this.sampler = new SimpleStatSampler(stopper, this); this.sampler.start(); } else { this.sampler = null; } }
@Test public void createOffHeapStorageWorks() { StatisticsFactory localStatsFactory = new LocalStatisticsFactory(null); InternalDistributedSystem ids = mock(InternalDistributedSystem.class); MemoryAllocator ma = OffHeapStorage.createOffHeapStorage(localStatsFactory, OffHeapStorage.MIN_SLAB_SIZE, ids); System.setProperty(MemoryAllocatorImpl.FREE_OFF_HEAP_MEMORY_PROPERTY, "true"); ma.close(); }
@Test public void testCreateOffHeapStorage() { StatisticsFactory localStatsFactory = new LocalStatisticsFactory(null); OutOfOffHeapMemoryListener ooohml = mock(OutOfOffHeapMemoryListener.class); MemoryAllocator ma =