github-actions[bot] commented on code in PR #38168: URL: https://github.com/apache/doris/pull/38168#discussion_r1685283494
########## be/src/runtime/workload_group/workload_group_manager.cpp: ########## @@ -149,46 +149,33 @@ void WorkloadGroupMgr::delete_workload_group_by_ids(std::set<uint64_t> used_wg_i struct WorkloadGroupMemInfo { int64_t total_mem_used = 0; - int64_t weighted_mem_used = 0; - bool is_low_wartermark = false; - bool is_high_wartermark = false; - double mem_used_ratio = 0; + std::list<std::shared_ptr<MemTrackerLimiter>> tracker_snapshots = + std::list<std::shared_ptr<MemTrackerLimiter>>(); }; -void WorkloadGroupMgr::refresh_wg_memory_info() { + +void WorkloadGroupMgr::refresh_wg_weighted_memory_ratio() { Review Comment: warning: function 'refresh_wg_weighted_memory_ratio' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp void WorkloadGroupMgr::refresh_wg_weighted_memory_ratio() { ^ ``` <details> <summary>Additional context</summary> **be/src/runtime/workload_group/workload_group_manager.cpp:155:** 83 lines including whitespace and comments (threshold 80) ```cpp void WorkloadGroupMgr::refresh_wg_weighted_memory_ratio() { ^ ``` </details> ########## be/src/runtime/memory/mem_tracker_limiter.h: ########## @@ -202,6 +202,18 @@ class MemTrackerLimiter final : public MemTracker { return querytid; } + void set_weighted_memory(int64_t weighted_limit, double weighted_ratio) { + std::lock_guard<std::mutex> l(_weighted_mem_lock); + _weighted_limit = weighted_limit; + _weighted_ratio = weighted_ratio; + } + + void get_weighted_memory(int64_t& weighted_limit, int64_t& weighted_consumption) { Review Comment: warning: method 'get_weighted_memory' can be made const [readability-make-member-function-const] ```suggestion void get_weighted_memory(int64_t& weighted_limit, int64_t& weighted_consumption) const { ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org