Skip to content

Commit 771d83d

Browse files
mymeiyiYour Name
authored andcommitted
[fix](group commit) add wal_max_count_per_table metric (#59583)
1 parent 7f5ba43 commit 771d83d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

be/src/olap/wal/wal_manager.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
namespace doris {
4141

4242
bvar::Status<size_t> g_wal_total_count("wal_total_count", 0);
43+
bvar::Status<size_t> g_wal_max_count_per_table("wal_max_count_per_table", 0);
4344

4445
WalManager::WalManager(ExecEnv* exec_env, const std::string& wal_dir_list)
4546
: _exec_env(exec_env),
@@ -204,9 +205,15 @@ size_t WalManager::get_wal_queue_size(int64_t table_id) {
204205
}
205206
} else {
206207
// table_id is -1 meaning get all table wal size
208+
size_t max_count_per_table = 0;
207209
for (auto& [_, table_wals] : _wal_queues) {
208-
count += table_wals.size();
210+
size_t table_wal_count = table_wals.size();
211+
count += table_wal_count;
212+
if (table_wal_count > max_count_per_table) {
213+
max_count_per_table = table_wal_count;
214+
}
209215
}
216+
g_wal_max_count_per_table.set_value(max_count_per_table);
210217
}
211218
return count;
212219
}

0 commit comments

Comments
 (0)