private void verifyRecoveryStats(final VM memberVM, final boolean localRecovery) {
    memberVM.invoke("verifyRecoveryStats", () -> {
      Cache cache = managementTestRule.getCache();
      Region region = cache.getRegion(REGION_NAME);
      DistributedRegion distributedRegion = (DistributedRegion) region;
      DiskRegionStats stats = distributedRegion.getDiskRegion().getStats();

      if (localRecovery) {
        assertThat(stats.getLocalInitializations()).isEqualTo(1);
        assertThat(stats.getRemoteInitializations()).isEqualTo(0);
      } else {
        assertThat(stats.getLocalInitializations()).isEqualTo(0);
        assertThat(stats.getRemoteInitializations()).isEqualTo(1);
      }
    });
  }
Compact a disk store from managerVM VM
geode-core/src/distributedTest/java/org/apache/geode/management/DiskManagementDUnitTest.java