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


##########
be/src/common/daemon.cpp:
##########
@@ -352,6 +354,65 @@ void Daemon::block_spill_gc_thread() {
     }
 }
 
+void Daemon::report_be_workload_runtime_stats_thread() {
+    while 
(!_stop_background_threads_latch.wait_for(std::chrono::milliseconds(1000))) {
+        std::map<TNetworkAddress, TReportWorkloadRuntimeStatusParams> 
fe_id_query_stats;
+        // 1 get merged query statistics
+        {
+            // add a code block here because we should release query_ctx_map 
quickly
+            std::unordered_map<TUniqueId, std::shared_ptr<QueryContext>>& 
query_ctx_map =
+                    
ExecEnv::GetInstance()->fragment_mgr()->get_query_ctx_map();
+
+            for (const auto& [query_id, query_ctx_ptr] : query_ctx_map) {
+                std::unique_ptr<QueryStatistics> query_stats =
+                        query_ctx_ptr->get_merged_query_statistics();
+                TNetworkAddress addr = query_ctx_ptr->coord_addr;
+                if (fe_id_query_stats.find(addr) == fe_id_query_stats.end()) {
+                    TReportWorkloadRuntimeStatusParams treport_params;
+                    treport_params.__set_backend_id(123);

Review Comment:
   BackendOptions::tbackend
   struct TBackend {
       1: required string host
       2: required TPort be_port
       3: required TPort http_port
       4: optional TPort brpc_port
       5: optional bool is_alive
       6: optional i64 id
   }



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