private Map<StatisticsType, Set<Statistics>> initAllStatistics() throws InterruptedException {
      assertTrue(statSampler.waitForInitialization(5000));

      Map<StatisticsType, Set<Statistics>> statsTypeToStats =
          new HashMap<>();
      Statistics[] stats = statSampler.getStatistics();
      for (final Statistics stat : stats) {
        StatisticsType statsType = stat.getType();
        Set<Statistics> statsSet = statsTypeToStats.get(statsType);
        if (statsSet == null) {
          statsSet = new HashSet<>();
          statsSet.add(stat);
          statsTypeToStats.put(statsType, statsSet);
        } else {
          statsSet.add(stat);
        }
      }
      return statsTypeToStats;
    }
Integration TestCase for StatSampler.

@since GemFire 7.0
geode-junit/src/main/java/org/apache/geode/internal/statistics/StatSamplerTestCase.java