@Test
  public void testTimeBasedCounters() throws InterruptedException {
    final long startTime = statisticsClock.getTime();

    cachePerfStats.startCacheListenerCall();
    cachePerfStats.startCacheWriterCall();
    partitionedRegionStats.startPutRemote();

    sample();

    cachePerfStats.endCacheListenerCall(startTime);
    cachePerfStats.endCacheWriterCall(startTime);
    partitionedRegionStats.endPutRemote(startTime);

    sample();

    assertTrue(getCacheListenerCallsAvgLatency() > 0);
    assertTrue(getCacheWriterCallsAvgLatency() > 0);
    assertTrue(getPutRemoteLatency() > 0);
  }
Implementing RegionMXBean to ensure test coverage
geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/RegionStatsJUnitTest.java