@@ -244,6 +244,7 @@ void CacheBase::updateGlobalCacheStats(const std::string& statPrefix) const {
244
244
statPrefix + " cache.size.configured" ,
245
245
memStats.configuredRamCacheSize + memStats.nvmCacheSize );
246
246
247
+ // TODO: add specific per-tier counters
247
248
const auto stats = getGlobalCacheStats ();
248
249
249
250
// Eviction Stats
@@ -253,7 +254,8 @@ void CacheBase::updateGlobalCacheStats(const std::string& statPrefix) const {
253
254
// from both ram and nvm, this is counted as a single eviction from cache.
254
255
// Ram Evictions: item evicted from ram but it can be inserted into nvm
255
256
const std::string ramEvictionKey = statPrefix + " ram.evictions" ;
256
- counters_.updateDelta (ramEvictionKey, stats.numEvictions );
257
+ counters_.updateDelta (ramEvictionKey,
258
+ std::accumulate (stats.numEvictions .begin (), stats.numEvictions .end (), 0 ));
257
259
// Nvm Evictions: item evicted from nvm but it can be still in ram
258
260
const std::string nvmEvictionKey = statPrefix + " nvm.evictions" ;
259
261
counters_.updateDelta (nvmEvictionKey, stats.numNvmEvictions );
@@ -295,11 +297,11 @@ void CacheBase::updateGlobalCacheStats(const std::string& statPrefix) const {
295
297
}
296
298
297
299
counters_.updateDelta (statPrefix + " cache.alloc_attempts" ,
298
- stats.allocAttempts );
300
+ std::accumulate ( stats.allocAttempts . begin (), stats. allocAttempts . end (), 0 ) );
299
301
counters_.updateDelta (statPrefix + " cache.eviction_attempts" ,
300
- stats.evictionAttempts );
302
+ std::accumulate ( stats.evictionAttempts . begin (),stats. evictionAttempts . end (), 0 ) );
301
303
counters_.updateDelta (statPrefix + " cache.alloc_failures" ,
302
- stats.allocFailures );
304
+ std::accumulate ( stats.allocFailures . begin (),stats. allocFailures . end (), 0 ) );
303
305
counters_.updateDelta (statPrefix + " cache.invalid_allocs" ,
304
306
stats.invalidAllocs );
305
307
0 commit comments