private List<AmbryStatsReport> getAmbryStatsReports(ServerConfig serverConfig) {
    // Other code
    List<AmbryStatsReport> ambryStatsReports = new ArrayList<>();
    Set<String> validStatsTypes = new HashSet<>();
    for (StatsReportType type : StatsReportType.values()) {
      validStatsTypes.add(type.toString());
    }

    // StatsManager would publish account stats to AccountStatsStore, and optionally publish partition class stats
    // as well. So if serverStatsReportsToPublish contains PARTITION_CLASS_REPORT, then be sure to enable partition
    // class stats with StatsManagerConfig.publishPartitionClassReportPeriodInSecs.
    // Also, since StatsManager is tightly coupled with mysql database right now, if variable accountStatsMySqlStore
    // is null, there is no report to aggregate and publish.
    if (!serverConfig.serverStatsReportsToPublish.isEmpty() && accountStatsMySqlStore != null) {
      serverConfig.serverStatsReportsToPublish.forEach(e -> {
        if (validStatsTypes.contains(e)) {
          ambryStatsReports.add(new AmbryStatsReportImpl(serverConfig.serverQuotaStatsAggregateIntervalInMinutes,
              StatsReportType.valueOf(e)));
        }
      });
    }

    return ambryStatsReports;
  }
Retrieves a list of AmbryStatsReport objects based on the server configuration.

@param serverConfig The {@link ServerConfig} containing the server's configuration.
@return A list of {@link AmbryStatsReport} objects to be published.
ambry-server/src/main/java/com/github/ambry/server/AmbryServer.java