You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-17 01:02:23 +03:00
Added printing the element count with the cache size on SIGUSR1.
Not atomic, but good enough for debugging purposes.
This commit is contained in:
@@ -429,11 +429,7 @@ void Cache::_makeSpace(size_t size)
|
||||
//logger->log(LOG_WARNING, "Cache: flushing!");
|
||||
Synchronizer::get()->flushObject(*it);
|
||||
cachedFile = prefix / *it; // Sync may have renamed it
|
||||
#ifndef NDEBUG
|
||||
assert(replicator->remove(cachedFile, Replicator::LOCAL_ONLY) == 0);
|
||||
#else
|
||||
replicator->remove(cachedFile, Replicator::LOCAL_ONLY);
|
||||
#endif
|
||||
LRU_t::iterator toRemove = it++;
|
||||
m_lru.erase(*toRemove);
|
||||
lru.erase(toRemove);
|
||||
@@ -491,6 +487,13 @@ size_t Cache::getCurrentCacheSize() const
|
||||
return currentCacheSize;
|
||||
}
|
||||
|
||||
size_t Cache::getCurrentCacheElementCount() const
|
||||
{
|
||||
boost::unique_lock<boost::recursive_mutex> s(lru_mutex);
|
||||
assert(m_lru.size() == lru.size());
|
||||
return m_lru.size();
|
||||
}
|
||||
|
||||
void Cache::reset()
|
||||
{
|
||||
boost::unique_lock<boost::recursive_mutex> s(lru_mutex);
|
||||
|
||||
@@ -44,6 +44,7 @@ class Cache : public boost::noncopyable
|
||||
void setMaxCacheSize(size_t size);
|
||||
void makeSpace(size_t size);
|
||||
size_t getCurrentCacheSize() const;
|
||||
size_t getCurrentCacheElementCount() const;
|
||||
size_t getMaxCacheSize() const;
|
||||
|
||||
// test helpers
|
||||
|
||||
@@ -20,6 +20,7 @@ using namespace storagemanager;
|
||||
void printCacheUsage(int sig)
|
||||
{
|
||||
cout << "Current cache size = " << Cache::get()->getCurrentCacheSize() << endl;
|
||||
cout << "Cache element count = " << Cache::get()->getCurrentCacheElementCount() << endl;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
||||
Reference in New Issue
Block a user