You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "HappenLee (via GitHub)" <gi...@apache.org> on 2023/06/08 03:41:38 UTC

[GitHub] [doris] HappenLee commented on a diff in pull request #20511: [improvement](profile)add sum/avg rpc time

HappenLee commented on code in PR #20511:
URL: https://github.com/apache/doris/pull/20511#discussion_r1222415261


##########
be/src/pipeline/exec/exchange_sink_buffer.cpp:
##########
@@ -305,25 +306,29 @@ bool ExchangeSinkBuffer::_is_receiver_eof(InstanceLoId id) {
 
 void ExchangeSinkBuffer::get_max_min_rpc_time(int64_t* max_time, int64_t* min_time) {
     int64_t local_max_time = 0;
-    int64_t local_min_time = 0;
-    auto iter = _instance_to_rpc_time.begin();
-    if (iter != _instance_to_rpc_time.end()) {
-        local_max_time = iter->second;
-        local_min_time = iter->second;
-        iter++;
-    }
-    while (iter != _instance_to_rpc_time.end()) {
-        int64_t cur_val = iter->second;
-        local_max_time = cur_val > local_max_time ? cur_val : local_max_time;
-        local_min_time = cur_val < local_min_time ? cur_val : local_min_time;
-        iter++;
+    int64_t local_min_time = INT64_MAX;
+    for (auto& [id, time] : _instance_to_rpc_time) {
+        if (time == 0) {

Review Comment:
   if (time != 0) {
           local_max_time = std::max(local_max_time, time);
           local_min_time = std::min(local_min_time, time);
   }



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org