void shutdown() {
    if (accountsStatsPublisher != null) {
      accountsStatsPublisher.cancel();
    }
    if (partitionClassStatsPublisher != null) {
      partitionClassStatsPublisher.cancel();
    }
    if (scheduler != null) {
      shutDownExecutorService(scheduler, 30, TimeUnit.SECONDS);
    }
  }
Stops the periodic task that is collecting, aggregating and publishing stats.
ambry-server/src/main/java/com/github/ambry/server/StatsManager.java