Skip to content

Commit c879923

Browse files
Fixed total cache size in stats
1 parent 403bca0 commit c879923

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cachelib/allocator/CacheAllocator-inl.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3610,7 +3610,10 @@ GlobalCacheStats CacheAllocator<CacheTrait>::getGlobalCacheStats() const {
36103610

36113611
template <typename CacheTrait>
36123612
CacheMemoryStats CacheAllocator<CacheTrait>::getCacheMemoryStats() const {
3613-
const auto totalCacheSize = allocator_[currentTier()]->getMemorySize();
3613+
size_t totalCacheSize = 0;
3614+
for(auto& allocator: allocator_) {
3615+
totalCacheSize += allocator->getMemorySize();
3616+
}
36143617

36153618
auto addSize = [this](size_t a, PoolId pid) {
36163619
return a + allocator_[currentTier()]->getPool(pid).getPoolSize();

0 commit comments

Comments
 (0)