removed display of "Dead" elements in cache since they are no longer used

This commit is contained in:
csoler 2021-01-04 13:57:54 +01:00
parent f1ccfb4d57
commit d0dffaa2a4
2 changed files with 12 additions and 15 deletions

View File

@ -1690,30 +1690,28 @@ void RsDataService::debug_printCacheSize()
{
RS_STACK_MUTEX(mDbMutex);
uint32_t nb_items,nb_items_on_deadlist;
uint64_t total_size,total_size_of_deadlist;
uint32_t nb_items;
uint64_t total_size;
mGrpMetaDataCache.debug_computeSize(nb_items, nb_items_on_deadlist, total_size,total_size_of_deadlist);
mGrpMetaDataCache.debug_computeSize(nb_items, total_size);
RsDbg() << "Cache size: " << std::endl;
RsDbg() << " Groups: " << " total: " << nb_items << " (dead: " << nb_items_on_deadlist << "), size: " << total_size << " (Dead: " << total_size_of_deadlist << ")" << std::endl;
RsDbg() << "[CACHE] Cache size: " << std::endl;
RsDbg() << "[CACHE] Groups: " << " total: " << nb_items << ", size: " << total_size << std::endl;
nb_items = 0,nb_items_on_deadlist = 0;
total_size = 0,total_size_of_deadlist = 0;
nb_items = 0;
total_size = 0;
for(auto& it:mMsgMetaDataCache)
{
uint32_t tmp_nb_items,tmp_nb_items_on_deadlist;
uint64_t tmp_total_size,tmp_total_size_of_deadlist;
uint32_t tmp_nb_items;
uint64_t tmp_total_size;
it.second.debug_computeSize(tmp_nb_items, tmp_nb_items_on_deadlist, tmp_total_size,tmp_total_size_of_deadlist);
it.second.debug_computeSize(tmp_nb_items, tmp_total_size);
nb_items += tmp_nb_items;
nb_items_on_deadlist += tmp_nb_items_on_deadlist;
total_size += tmp_total_size;
total_size_of_deadlist += tmp_total_size_of_deadlist;
}
RsDbg() << " Msgs: " << " total: " << nb_items << " (dead: " << nb_items_on_deadlist << "), size: " << total_size << " (Dead: " << total_size_of_deadlist << ")" << std::endl;
RsDbg() << "[CACHE] Msgs: " << " total: " << nb_items << ", size: " << total_size << std::endl;
}

View File

@ -105,11 +105,10 @@ public:
}
}
void debug_computeSize(uint32_t& nb_items, uint32_t& nb_items_on_deadlist, uint64_t& total_size,uint64_t& total_size_of_deadlist) const
void debug_computeSize(uint32_t& nb_items, uint64_t& total_size) const
{
nb_items = mMetas.size();
total_size = 0;
total_size_of_deadlist = 0;
for(auto it:mMetas) total_size += it.second->serial_size();
}