void start() {
    if (accountStatsStore != null) {
      accountsStatsPublisher = new AccountStatsPublisher(accountStatsStore);
      int actualDelay = config.initialDelayUpperBoundInSecs > 0 ? ThreadLocalRandom.current()
          .nextInt(config.initialDelayUpperBoundInSecs) : 0;
      logger.info("Scheduling account stats publishing job with an initial delay of {} secs", actualDelay);
      scheduler.scheduleAtFixedRate(accountsStatsPublisher, actualDelay, config.publishPeriodInSecs, TimeUnit.SECONDS);

      if (config.publishPartitionClassReportPeriodInSecs != 0) {
        partitionClassStatsPublisher = new PartitionClassStatsPublisher(accountStatsStore);
        long initialDelay = ThreadLocalRandom.current().nextLong(config.publishPartitionClassReportPeriodInSecs / 2)
            + config.publishPartitionClassReportPeriodInSecs / 2;
        logger.info("Scheduling partition class stats publishing job with an initial delay of {} secs", initialDelay);
        scheduler.scheduleAtFixedRate(partitionClassStatsPublisher, initialDelay,
            config.publishPartitionClassReportPeriodInSecs, TimeUnit.SECONDS);
      }
    }
  }
Start the stats manager by scheduling the periodic task that collect, aggregate and publish stats.
ambry-server/src/main/java/com/github/ambry/server/StatsManager.java