diff --git a/be/src/io/cache/block_file_cache.cpp b/be/src/io/cache/block_file_cache.cpp index c55e9dac76c180..1e16d79dc5c057 100644 --- a/be/src/io/cache/block_file_cache.cpp +++ b/be/src/io/cache/block_file_cache.cpp @@ -87,6 +87,10 @@ BlockFileCache::BlockFileCache(const std::string& cache_base_path, _cache_base_path.c_str(), "file_cache_ttl_cache_evict_size"); _total_evict_size_metrics = std::make_shared>( _cache_base_path.c_str(), "file_cache_total_evict_size"); + _gc_evict_bytes_metrics = std::make_shared>(_cache_base_path.c_str(), + "file_cache_gc_evict_bytes"); + _gc_evict_count_metrics = std::make_shared>(_cache_base_path.c_str(), + "file_cache_gc_evict_count"); _evict_by_time_metrics_matrix[FileCacheType::DISPOSABLE][FileCacheType::NORMAL] = std::make_shared>(_cache_base_path.c_str(), @@ -1146,6 +1150,8 @@ void BlockFileCache::remove_if_cached_async(const UInt128Wrapper& file_key) { std::vector to_remove; if (iter != _files.end()) { for (auto& [_, cell] : iter->second) { + *_gc_evict_bytes_metrics << cell.size(); + *_gc_evict_count_metrics << 1; if (cell.releasable()) { to_remove.push_back(&cell); } else { diff --git a/be/src/io/cache/block_file_cache.h b/be/src/io/cache/block_file_cache.h index c12b03cc998792..7c046cc162783a 100644 --- a/be/src/io/cache/block_file_cache.h +++ b/be/src/io/cache/block_file_cache.h @@ -546,6 +546,8 @@ class BlockFileCache { std::shared_ptr> _cur_disposable_queue_cache_size_metrics; std::array>, 4> _queue_evict_size_metrics; std::shared_ptr> _total_evict_size_metrics; + std::shared_ptr> _gc_evict_bytes_metrics; + std::shared_ptr> _gc_evict_count_metrics; std::shared_ptr> _evict_by_time_metrics_matrix[4][4]; std::shared_ptr> _evict_by_size_metrics_matrix[4][4]; std::shared_ptr> _evict_by_self_lru_metrics_matrix[4];