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


##########
be/src/runtime/query_context.cpp:
##########
@@ -297,4 +319,161 @@ Status QueryContext::set_workload_group(WorkloadGroupPtr& 
tg) {
     return Status::OK();
 }
 
+void QueryContext::add_fragment_profile_x(
+        int fragment_id, const 
std::vector<std::shared_ptr<TRuntimeProfileTree>>& pipeline_profiles,
+        std::shared_ptr<TRuntimeProfileTree> load_channel_profile) {
+    if (pipeline_profiles.empty()) {
+        std::string msg = fmt::format("Add pipeline profile failed, query {}, 
fragment {}",
+                                      print_id(this->_query_id), fragment_id);
+        LOG_ERROR(msg);
+        DCHECK(false) << msg;
+        return;
+    }
+
+#ifndef NDEBUG
+    for (const auto& p : pipeline_profiles) {
+        DCHECK(p != nullptr) << fmt::format("Add pipeline profile failed, 
query {}, fragment {}",
+                                            print_id(this->_query_id), 
fragment_id);
+    }
+#endif
+
+    std::lock_guard<std::mutex> l(_profile_mutex);
+    LOG_INFO("Query X add fragment profile, query {}, fragment {}, pipeline 
profile count {} ",
+             print_id(this->_query_id), fragment_id, pipeline_profiles.size());
+
+    _profile_map_x.insert(std::make_pair(fragment_id, pipeline_profiles));
+
+    if (load_channel_profile != nullptr) {
+        _load_channel_profile_map_x.insert(std::make_pair(fragment_id, 
load_channel_profile));
+    }
+}
+
+void QueryContext::add_instance_profile(const TUniqueId& instance_id,
+                                        std::shared_ptr<TRuntimeProfileTree> 
profile,
+                                        std::shared_ptr<TRuntimeProfileTree> 
load_channel_profile) {
+    DCHECK(profile != nullptr) << print_id(instance_id);
+
+    std::lock_guard<std::mutex> lg(_profile_mutex);
+    _profile_map.insert(std::make_pair(instance_id, profile));
+    if (load_channel_profile != nullptr) {
+        _load_channel_profile_map.insert(std::make_pair(instance_id, 
load_channel_profile));
+    }
+}
+
+void QueryContext::_report_query_profile() {
+    _report_query_profile_x();
+    _report_query_profile_non_pipeline();
+}
+
+void QueryContext::_report_query_profile_non_pipeline() {
+    if (enable_pipeline_exec()) {

Review Comment:
   enable_pipeline_exec || enable_pipelinex_exec



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