in cachelib/allocator/CacheStats.cpp [50:137]
void Stats::populateGlobalCacheStats(GlobalCacheStats& ret) const {
#ifndef SKIP_SIZE_VERIFY
SizeVerify<sizeof(Stats)> a = SizeVerify<16144>{};
std::ignore = a;
#endif
ret.numCacheGets = numCacheGets.get();
ret.numCacheGetMiss = numCacheGetMiss.get();
ret.numCacheGetExpiries = numCacheGetExpiries.get();
ret.numCacheRemoves = numCacheRemoves.get();
ret.numCacheRemoveRamHits = numCacheRemoveRamHits.get();
ret.numRamDestructorCalls = numRamDestructorCalls.get();
ret.numDestructorExceptions = numDestructorExceptions.get();
ret.numNvmGets = numNvmGets.get();
ret.numNvmGetMiss = numNvmGetMiss.get();
ret.numNvmGetMissFast = numNvmGetMissFast.get();
ret.numNvmGetMissExpired = numNvmGetMissExpired.get();
ret.numNvmGetMissDueToInflightRemove = numNvmGetMissDueToInflightRemove.get();
ret.numNvmGetMissErrs = numNvmGetMissErrs.get();
ret.numNvmGetCoalesced = numNvmGetCoalesced.get();
ret.numNvmPuts = numNvmPuts.get();
ret.numNvmDeletes = numNvmDeletes.get();
ret.numNvmSkippedDeletes = numNvmSkippedDeletes.get();
ret.numNvmPutErrs = numNvmPutErrs.get();
ret.numNvmPutEncodeFailure = numNvmPutEncodeFailure.get();
ret.numNvmAbortedPutOnTombstone += numNvmAbortedPutOnTombstone.get();
ret.numNvmCompactionFiltered += numNvmCompactionFiltered.get();
ret.numNvmAbortedPutOnInflightGet = numNvmAbortedPutOnInflightGet.get();
ret.numNvmCleanEvict = numNvmCleanEvict.get();
ret.numNvmCleanDoubleEvict = numNvmCleanDoubleEvict.get();
ret.numNvmDestructorCalls = numNvmDestructorCalls.get();
ret.numNvmDestructorRefcountOverflow = numNvmDestructorRefcountOverflow.get();
ret.numNvmExpiredEvict = numNvmExpiredEvict.get();
ret.numNvmPutFromClean = numNvmPutFromClean.get();
ret.numNvmEvictions = numNvmEvictions.get();
ret.numNvmEncryptionErrors = numNvmEncryptionErrors.get();
ret.numNvmDecryptionErrors = numNvmDecryptionErrors.get();
ret.numNvmRejectsByExpiry = numNvmRejectsByExpiry.get();
ret.numNvmRejectsByClean = numNvmRejectsByClean.get();
ret.numNvmRejectsByAP = numNvmRejectsByAP.get();
ret.numChainedParentItems = numChainedParentItems.get();
ret.numChainedChildItems = numChainedChildItems.get();
ret.numNvmAllocAttempts = numNvmAllocAttempts.get();
ret.numNvmAllocForItemDestructor = numNvmAllocForItemDestructor.get();
ret.numNvmItemDestructorAllocErrors = numNvmItemDestructorAllocErrors.get();
ret.allocateLatencyNs = this->allocateLatency_.estimate();
ret.moveChainedLatencyNs = this->moveChainedLatency_.estimate();
ret.moveRegularLatencyNs = this->moveRegularLatency_.estimate();
ret.nvmLookupLatencyNs = this->nvmLookupLatency_.estimate();
ret.nvmInsertLatencyNs = this->nvmInsertLatency_.estimate();
ret.nvmRemoveLatencyNs = this->nvmRemoveLatency_.estimate();
ret.ramEvictionAgeSecs = this->ramEvictionAgeSecs_.estimate();
ret.ramItemLifeTimeSecs = this->ramItemLifeTimeSecs_.estimate();
ret.nvmSmallLifetimeSecs = this->nvmSmallLifetimeSecs_.estimate();
ret.nvmLargeLifetimeSecs = this->nvmLargeLifetimeSecs_.estimate();
ret.nvmEvictionSecondsPastExpiry =
this->nvmEvictionSecondsPastExpiry_.estimate();
ret.nvmEvictionSecondsToExpiry = this->nvmEvictionSecondsToExpiry_.estimate();
ret.nvmPutSize = this->nvmPutSize_.estimate();
auto accum = [](const PerPoolClassAtomicCounters& c) {
uint64_t sum = 0;
for (const auto& x : c) {
for (const auto& v : x) {
sum += v.get();
}
}
return sum;
};
ret.allocAttempts = accum(*allocAttempts);
ret.allocFailures = accum(*allocFailures);
ret.numEvictions = accum(*chainedItemEvictions);
ret.numEvictions += accum(*regularItemEvictions);
ret.invalidAllocs = invalidAllocs.get();
ret.numRefcountOverflow = numRefcountOverflow.get();
ret.numEvictionFailureFromAccessContainer = evictFailAC.get();
ret.numEvictionFailureFromConcurrentFill = evictFailConcurrentFill.get();
ret.numEvictionFailureFromParentAccessContainer = evictFailParentAC.get();
ret.numEvictionFailureFromMoving = evictFailMove.get();
ret.numEvictionFailureFromParentMoving = evictFailParentMove.get();
ret.numAbortedSlabReleases = numAbortedSlabReleases.get();
}