github-actions[bot] commented on code in PR #32039:
URL: https://github.com/apache/doris/pull/32039#discussion_r1528422230


##########
be/src/runtime/query_context.cpp:
##########
@@ -46,48 +47,53 @@ QueryContext::QueryContext(TUniqueId query_id, int 
total_fragment_num, ExecEnv*
           _is_pipeline(is_pipeline),
           _is_nereids(is_nereids),
           _query_options(query_options) {
+    _init_query_mem_tracker();
+    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(query_mem_tracker);
     this->coord_addr = coord_addr;
     _start_time = VecDateTimeValue::local_time();
     _shared_hash_table_controller.reset(new 
vectorized::SharedHashTableController());
     _shared_scanner_controller.reset(new 
vectorized::SharedScannerController());
     _execution_dependency =
             pipeline::Dependency::create_unique(-1, -1, "ExecutionDependency", 
this);
     _runtime_filter_mgr = std::make_unique<RuntimeFilterMgr>(
-            TUniqueId(), RuntimeFilterParamsContext::create(this));
+            TUniqueId(), RuntimeFilterParamsContext::create(this), 
query_mem_tracker);
 
     timeout_second = query_options.execution_timeout;
 
-    bool has_query_mem_tracker = query_options.__isset.mem_limit && 
(query_options.mem_limit > 0);
-    int64_t _bytes_limit = has_query_mem_tracker ? query_options.mem_limit : 
-1;
+    register_memory_statistics();
+    register_cpu_statistics();
+}
+
+void QueryContext::_init_query_mem_tracker() {

Review Comment:
   warning: method '_init_query_mem_tracker' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/runtime/query_context.h:297:
   ```diff
   -     void _init_query_mem_tracker();
   +     static void _init_query_mem_tracker();
   ```
   



-- 
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

Reply via email to