mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
dbms: profile event UncompressedCacheWeightLost [METR-10570]
This commit is contained in:
parent
a670bd654b
commit
d0452204ad
@ -112,8 +112,13 @@ public:
|
||||
current_size = 0;
|
||||
hits = 0;
|
||||
misses = 0;
|
||||
current_weight_lost = 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t current_weight_lost = 0;
|
||||
/// Суммарный вес выброшенных из кеша элементов.
|
||||
/// Обнуляется каждый раз, когда информация добавляется в Profile events
|
||||
private:
|
||||
typedef std::list<Key> LRUQueue;
|
||||
typedef typename LRUQueue::iterator LRUQueueIterator;
|
||||
@ -148,6 +153,7 @@ private:
|
||||
const Key & key = queue.front();
|
||||
auto it = cells.find(key);
|
||||
current_size -= it->second.size;
|
||||
current_weight_lost += it->second.size;
|
||||
cells.erase(it);
|
||||
queue.pop_front();
|
||||
--queue_size;
|
||||
|
@ -19,6 +19,7 @@
|
||||
M(CompressedReadBufferBytes, "Read decompressed bytes") \
|
||||
M(UncompressedCacheHits, "Uncompressed cache hits") \
|
||||
M(UncompressedCacheMisses, "Uncompressed cache misses") \
|
||||
M(UncompressedCacheWeightLost, "Uncompressed cache weight lost") \
|
||||
M(IOBufferAllocs, "IO buffers allocations") \
|
||||
M(IOBufferAllocBytes, "IO buffers allocated bytes") \
|
||||
M(ArenaAllocChunks, "Arena allocated chunks") \
|
||||
|
@ -61,6 +61,13 @@ public:
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void set(const Key & key, MappedPtr mapped)
|
||||
{
|
||||
Base::set(key, mapped);
|
||||
ProfileEvents::increment(ProfileEvents::UncompressedCacheWeightLost, current_weight_lost);
|
||||
current_weight_lost = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef Poco::SharedPtr<UncompressedCache> UncompressedCachePtr;
|
||||
|
Loading…
Reference in New Issue
Block a user