This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new d3148dced23 branch-3.0: [enhancement](cloud) monitor evict size of 
file cache active gc #51197 (#51793)
d3148dced23 is described below

commit d3148dced233b92be71e13c644136fe68c4817d8
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jun 20 09:52:32 2025 +0800

    branch-3.0: [enhancement](cloud) monitor evict size of file cache active gc 
#51197 (#51793)
    
    Cherry-picked from #51197
    
    Signed-off-by: zhengyu <[email protected]>
    Co-authored-by: zhengyu <[email protected]>
---
 be/src/io/cache/block_file_cache.cpp | 6 ++++++
 be/src/io/cache/block_file_cache.h   | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/be/src/io/cache/block_file_cache.cpp 
b/be/src/io/cache/block_file_cache.cpp
index 39e1a4ae28a..72bbd708506 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<bvar::Adder<size_t>>(
             _cache_base_path.c_str(), "file_cache_total_evict_size");
+    _gc_evict_bytes_metrics = 
std::make_shared<bvar::Adder<size_t>>(_cache_base_path.c_str(),
+                                                                    
"file_cache_gc_evict_bytes");
+    _gc_evict_count_metrics = 
std::make_shared<bvar::Adder<size_t>>(_cache_base_path.c_str(),
+                                                                    
"file_cache_gc_evict_count");
 
     
_evict_by_time_metrics_matrix[FileCacheType::DISPOSABLE][FileCacheType::NORMAL] 
=
             std::make_shared<bvar::Adder<size_t>>(_cache_base_path.c_str(),
@@ -1146,6 +1150,8 @@ void BlockFileCache::remove_if_cached_async(const 
UInt128Wrapper& file_key) {
         std::vector<FileBlockCell*> 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 c12b03cc998..7c046cc1627 100644
--- a/be/src/io/cache/block_file_cache.h
+++ b/be/src/io/cache/block_file_cache.h
@@ -546,6 +546,8 @@ private:
     std::shared_ptr<bvar::Status<size_t>> 
_cur_disposable_queue_cache_size_metrics;
     std::array<std::shared_ptr<bvar::Adder<size_t>>, 4> 
_queue_evict_size_metrics;
     std::shared_ptr<bvar::Adder<size_t>> _total_evict_size_metrics;
+    std::shared_ptr<bvar::Adder<size_t>> _gc_evict_bytes_metrics;
+    std::shared_ptr<bvar::Adder<size_t>> _gc_evict_count_metrics;
     std::shared_ptr<bvar::Adder<size_t>> _evict_by_time_metrics_matrix[4][4];
     std::shared_ptr<bvar::Adder<size_t>> _evict_by_size_metrics_matrix[4][4];
     std::shared_ptr<bvar::Adder<size_t>> _evict_by_self_lru_metrics_matrix[4];


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to