@Override
  public void start() {
    synchronized (lock) {
      switch (currentState) {
        case INIT:
          currentState = State.RUNNING;
          schedulerService.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
              sampleStatistics();
            }
          }, pollingIntervalMillis, pollingIntervalMillis, TimeUnit.MILLISECONDS);
          break;

        case RUNNING:
          return;

        case STOPPED:
          throw new IllegalStateException("Attempting to start an already stopped StatisticsMonitor");
      }
    }
  }
Creates a new {@link StatisticsMonitorImpl} that reports statistics periodically
@param pollingIntervalMillis The polling interval to report statistics.
@param statisticsGetter the getter to gather system stats info
samza-core/src/main/java/org/apache/samza/container/host/StatisticsMonitorImpl.java