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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 425d6efa054 branch-4.0: [fix](group commit) add 
wal_max_count_per_table metric #59583 (#59612)
425d6efa054 is described below

commit 425d6efa05414bb7e8abacebba185954481c0bec
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 7 18:00:55 2026 +0800

    branch-4.0: [fix](group commit) add wal_max_count_per_table metric #59583 
(#59612)
    
    Cherry-picked from #59583
    
    Co-authored-by: meiyi <[email protected]>
---
 be/src/olap/wal/wal_manager.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/wal/wal_manager.cpp b/be/src/olap/wal/wal_manager.cpp
index 9ef29be9e35..7ebf97a8ac8 100644
--- a/be/src/olap/wal/wal_manager.cpp
+++ b/be/src/olap/wal/wal_manager.cpp
@@ -40,6 +40,7 @@
 namespace doris {
 
 bvar::Status<size_t> g_wal_total_count("wal_total_count", 0);
+bvar::Status<size_t> g_wal_max_count_per_table("wal_max_count_per_table", 0);
 
 WalManager::WalManager(ExecEnv* exec_env, const std::string& wal_dir_list)
         : _exec_env(exec_env),
@@ -204,9 +205,15 @@ size_t WalManager::get_wal_queue_size(int64_t table_id) {
         }
     } else {
         // table_id is -1 meaning get all table wal size
+        size_t max_count_per_table = 0;
         for (auto& [_, table_wals] : _wal_queues) {
-            count += table_wals.size();
+            size_t table_wal_count = table_wals.size();
+            count += table_wal_count;
+            if (table_wal_count > max_count_per_table) {
+                max_count_per_table = table_wal_count;
+            }
         }
+        g_wal_max_count_per_table.set_value(max_count_per_table);
     }
     return count;
 }


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

Reply via email to