This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0-beta in repository https://gitbox.apache.org/repos/asf/doris.git
commit ff68730d3c076fb27de34d409b7e907d76612deb Author: Yongqiang YANG <[email protected]> AuthorDate: Fri Jun 9 08:39:35 2023 +0800 [enhancement](heartbeat) print a warning log for long running heartbeat (#20559) --- be/src/agent/heartbeat_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/be/src/agent/heartbeat_server.cpp b/be/src/agent/heartbeat_server.cpp index 45ad3009f6..d353692c9d 100644 --- a/be/src/agent/heartbeat_server.cpp +++ b/be/src/agent/heartbeat_server.cpp @@ -64,6 +64,8 @@ void HeartbeatServer::heartbeat(THeartbeatResult& heartbeat_result, << ", cluster id:" << master_info.cluster_id << ", counter:" << google::COUNTER << ", BE start time: " << _be_epoch; + MonotonicStopWatch watch; + watch.start(); // do heartbeat Status st = _heartbeat(master_info); st.to_thrift(&heartbeat_result.status); @@ -77,6 +79,10 @@ void HeartbeatServer::heartbeat(THeartbeatResult& heartbeat_result, heartbeat_result.backend_info.__set_be_start_time(_be_epoch); heartbeat_result.backend_info.__set_be_node_role(config::be_node_role); } + watch.stop(); + if (watch.elapsed_time() > 1000L * 1000L * 1000L) { + LOG(WARNING) << "heartbeat consume too much time. time=" << watch.elapsed_time(); + } } Status HeartbeatServer::_heartbeat(const TMasterInfo& master_info) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
