static StatMonitorHandler getStatMonitorHandler() {
    // sync SampleCollector.class and then instance.sampleHandlers
    synchronized (SampleCollector.class) {
      if (instance == null) {
        throw new IllegalStateException("Statistics sampler is not available");
      }
      synchronized (instance.sampleHandlers) {
        StatMonitorHandler handler = instance.statMonitorHandler;
        if (handler == null) {
          handler = new StatMonitorHandler();
          instance.addSampleHandler(handler);
          instance.statMonitorHandler = handler;
        }
        return handler;
      }
    }
  }
Returns the {@link StatMonitorHandler}. If one does not currently exist it will be created.

@return the StatMonitorHandler for adding monitors
@throws IllegalStateException if no SampleCollector has been created and initialized yet
geode-core/src/main/java/org/apache/geode/internal/statistics/SampleCollector.java