@Test
  public void testPopulate1kbwrites() {
    RegionAttributes ra = region.getAttributes();
    // final String key = "K";
    final byte[] value = new byte[ENTRY_SIZE];
    Arrays.fill(value, (byte) 77);
    String config = "ENTRY_SIZE=" + ENTRY_SIZE + " OP_COUNT=" + OP_COUNT + " UNIQUE_KEYS="
        + UNIQUE_KEYS + " opLogEnabled="
        + !Boolean.getBoolean(GeodeGlossary.GEMFIRE_PREFIX + "disableOpLog") + " syncWrites="
        + Boolean.getBoolean(GeodeGlossary.GEMFIRE_PREFIX + "syncWrites");
    if (ra.getDiskStoreName() != null) {
      config += " diskStoreName=" + ra.getDiskStoreName();
    } else {
      config += " [" + ra.getDiskWriteAttributes() + "]";
    }
    log.info(config);
    // for recovery test:
    region.put("5", "5");
    region.put("3000", "3000");
    region.put("7000", "7000");
    region.put("100", "100");
    region.put("9999", "9999");
    region.put("794", "794");
    region.put("123", "123");
    region.put("4768", "4768");
    region.put("987", "987");

    long startTime = System.currentTimeMillis();
    if (UNIQUE_KEYS) {
      for (int i = 0; i < OP_COUNT; i++) {

        region.put(i, value);
      }
    } else {
      for (int i = 0; i < OP_COUNT; i++) {
        region.put("" + (i + 10000), value);
      }
    }

    long endTime = System.currentTimeMillis();
    long et = endTime - startTime;
    long etSecs = et / 1000;
    long opPerSec = etSecs == 0 ? 0 : (OP_COUNT / (et / 1000));
    long bytesPerSec = etSecs == 0 ? 0 : ((OP_COUNT * ENTRY_SIZE) / (et / 1000));

    String stats = "et=" + et + "ms writes/sec=" + opPerSec + " bytes/sec=" + bytesPerSec;
    log.info(stats);
    System.out.println("Stats for 1kb writes:" + stats);
    // close the cache after that create it again and then get the values to
    // test recovery.
    if (cache != null) {
      cache.close();
      System.out.println("Cache closed");
    }

    // create the cache
    try {
      cache = createCache();
      region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
      System.out.println("Cache created to test the recovery..");
    } catch (Exception e) {
      e.printStackTrace();
      fail("failed while creating the cache ");
    }
    // Get all the test values:
    System.out.println(region.get("5"));
    System.out.println(region.get("3000"));
    System.out.println(region.get("7000"));
    System.out.println(region.get("100"));
    System.out.println(region.get("9999"));
    System.out.println(region.get("794"));
    System.out.println(region.get("123"));
    System.out.println(region.get("4768"));
    System.out.println(region.get("987"));
    // Verifying the get operation:
    assertTrue((region.get("5").toString()).equals("5"));
    assertTrue((region.get("3000").toString()).equals("3000"));
    assertTrue((region.get("7000").toString()).equals("7000"));
    assertTrue((region.get("100").toString()).equals("100"));
    assertTrue((region.get("9999").toString()).equals("9999"));
    assertTrue((region.get("794").toString()).equals("794"));
    assertTrue((region.get("123").toString()).equals("123"));
    assertTrue((region.get("4768").toString()).equals("4768"));
    assertTrue((region.get("987").toString()).equals("987"));
    closeDown();
  }
Disk region perf test for Persist only with sync writes.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java