Search in sources :

Example 16 with AggregatedAccountStorageStats

use of com.github.ambry.server.storagestats.AggregatedAccountStorageStats in project ambry by linkedin.

the class AccountStatsMySqlStore method queryAggregatedAccountStorageStatsByClusterName.

@Override
public AggregatedAccountStorageStats queryAggregatedAccountStorageStatsByClusterName(String clusterName) throws Exception {
    long startTimeMs = System.currentTimeMillis();
    AggregatedAccountStorageStats aggregatedAccountStorageStats = new AggregatedAccountStorageStats(null);
    aggregatedAccountReportsDao.queryContainerUsageForCluster(clusterName, (accountId, containerStats) -> {
        aggregatedAccountStorageStats.addContainerStorageStats(accountId, containerStats);
    });
    storeMetrics.queryAggregatedStatsTimeMs.update(System.currentTimeMillis() - startTimeMs);
    return aggregatedAccountStorageStats;
}
Also used : AggregatedAccountStorageStats(com.github.ambry.server.storagestats.AggregatedAccountStorageStats)

Aggregations

AggregatedAccountStorageStats (com.github.ambry.server.storagestats.AggregatedAccountStorageStats)16 HashMap (java.util.HashMap)12 Map (java.util.Map)12 Test (org.junit.Test)10 StorageStatsUtilTest (com.github.ambry.server.StorageStatsUtilTest)8 ContainerStorageStats (com.github.ambry.server.storagestats.ContainerStorageStats)7 HostAccountStorageStatsWrapper (com.github.ambry.server.HostAccountStorageStatsWrapper)6 HostAccountStorageStats (com.github.ambry.server.storagestats.HostAccountStorageStats)5 StatsHeader (com.github.ambry.server.StatsHeader)4 LinkedHashMap (java.util.LinkedHashMap)4 Pair (com.github.ambry.utils.Pair)3 MockRestRequest (com.github.ambry.rest.MockRestRequest)2 MockRestResponseChannel (com.github.ambry.rest.MockRestResponseChannel)2 RestRequest (com.github.ambry.rest.RestRequest)2 StatsSnapshot (com.github.ambry.server.StatsSnapshot)2 AggregatedPartitionClassStorageStats (com.github.ambry.server.storagestats.AggregatedPartitionClassStorageStats)2 Histogram (com.codahale.metrics.Histogram)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 RestResponseChannel (com.github.ambry.rest.RestResponseChannel)1 RestServiceException (com.github.ambry.rest.RestServiceException)1