yiguolei commented on code in PR #33331:
URL: https://github.com/apache/doris/pull/33331#discussion_r1555153834


##########
be/src/runtime/query_context.h:
##########
@@ -351,6 +357,59 @@ class QueryContext {
     std::mutex _weighted_mem_lock;
     int64_t _weighted_consumption = 0;
     int64_t _weighted_limit = 0;
+
+    std::mutex _profile_mutex;
+
+    // when fragment of pipeline x is closed, it will register its profile to 
this map by using add_fragment_profile_x
+    // flatten profile of one fragment:
+    // Pipeline 0
+    //      PipelineTask 0
+    //              Operator 1
+    //              Operator 2
+    //              Scanner
+    //      PipelineTask 1
+    //              Operator 1
+    //              Operator 2
+    //              Scanner
+    // Pipeline 1
+    //      PipelineTask 2
+    //              Operator 3
+    //      PipelineTask 3
+    //              Operator 3
+    // fragment_id -> list<profile>
+    std::unordered_map<int, std::vector<std::shared_ptr<TRuntimeProfileTree>>> 
_profile_map_x;
+    std::unordered_map<int, std::shared_ptr<TRuntimeProfileTree>> 
_load_channel_profile_map_x;
+
+    // instance_id -> profile
+    std::unordered_map<TUniqueId, std::shared_ptr<TRuntimeProfileTree>> 
_profile_map;
+    std::unordered_map<TUniqueId, std::shared_ptr<TRuntimeProfileTree>> 
_load_channel_profile_map;
+
+    void _report_query_profile();
+    void _report_query_profile_non_pipeline();
+    void _report_query_profile_x();
+
+    std::unordered_map<int, std::vector<std::shared_ptr<TRuntimeProfileTree>>>
+    _collect_realtime_query_profile_x() const;
+
+    std::unordered_map<TUniqueId, 
std::vector<std::shared_ptr<TRuntimeProfileTree>>>
+    _collect_realtime_query_profile_non_pipeline() const;
+
+public:
+    // when fragment of pipeline x is closed, it will register its profile to 
this map by using add_fragment_profile_x
+    void add_fragment_profile_x(
+            int fragment_id,
+            const std::vector<std::shared_ptr<TRuntimeProfileTree>>& 
pipeline_profile,
+            std::shared_ptr<TRuntimeProfileTree> load_channel_profile);
+
+    void add_instance_profile(const TUniqueId& iid, 
std::shared_ptr<TRuntimeProfileTree> profile,
+                              std::shared_ptr<TRuntimeProfileTree> 
load_channel_profile);
+
+    TReportExecStatusParams get_realtime_exec_status_x() const;
+
+    bool enable_profile() const {
+        return true;

Review Comment:
   why always return true?



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