zhiqiang-hhhh commented on code in PR #49688: URL: https://github.com/apache/doris/pull/49688#discussion_r2030053767
########## be/src/vec/exec/jni_connector.cpp: ########## @@ -82,12 +87,15 @@ Status JniConnector::open(RuntimeState* state, RuntimeProfile* profile) { batch_size = _state->batch_size(); } RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); - SCOPED_TIMER(_open_scanner_time); + MonotonicStopWatch _watch; + _watch.start(); _scanner_params.emplace("time_zone", _state->timezone()); RETURN_IF_ERROR(_init_jni_scanner(env, batch_size)); // Call org.apache.doris.common.jni.JniScanner#open env->CallVoidMethod(_jni_scanner_obj, _jni_scanner_open); RETURN_ERROR_IF_EXC(env); + _watch.stop(); Review Comment: what if `open` returned before this line ########## be/src/vec/exec/jni_connector.cpp: ########## @@ -113,11 +121,16 @@ Status JniConnector::get_next_block(Block* block, size_t* read_rows, bool* eof) JNIEnv* env = nullptr; RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); long meta_address = 0; - { - SCOPED_TIMER(_java_scan_time); - meta_address = env->CallLongMethod(_jni_scanner_obj, _jni_scanner_get_next_batch); - } + + MonotonicStopWatch _watch; + _watch.start(); + meta_address = env->CallLongMethod(_jni_scanner_obj, _jni_scanner_get_next_batch); RETURN_ERROR_IF_EXC(env); + _watch.stop(); Review Comment: what if returned at line 128 ########## fe/fe-core/src/main/java/org/apache/doris/common/profile/Profile.java: ########## @@ -295,6 +295,7 @@ public synchronized void updateSummary(Map<String, String> summaryInfo, boolean } return; } + summaryProfile.queryFinished(); Review Comment: why adding this line? ########## be/src/util/runtime_profile.h: ########## @@ -278,6 +278,39 @@ class RuntimeProfile { DerivedCounterFunction _counter_fn; }; + using ConditionCounterFunction = std::function<bool(int64_t, int64_t)>; + + class ConditionCounter : public Counter { Review Comment: add comment to explain the usage ########## fe/fe-core/src/main/java/org/apache/doris/common/profile/SummaryProfile.java: ########## @@ -179,7 +185,12 @@ public class SummaryProfile { TRACE_ID, TRANSACTION_COMMIT_TIME, SYSTEM_MESSAGE, - EXECUTED_BY_FRONTEND + EXECUTED_BY_FRONTEND, + NEREIDS_BE_FOLD_CONST_TIME, Review Comment: why need this ########## be/src/vec/exec/jni_connector.cpp: ########## @@ -113,11 +121,16 @@ Status JniConnector::get_next_block(Block* block, size_t* read_rows, bool* eof) JNIEnv* env = nullptr; RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env)); long meta_address = 0; - { - SCOPED_TIMER(_java_scan_time); - meta_address = env->CallLongMethod(_jni_scanner_obj, _jni_scanner_get_next_batch); - } + + MonotonicStopWatch _watch; + _watch.start(); + meta_address = env->CallLongMethod(_jni_scanner_obj, _jni_scanner_get_next_batch); RETURN_ERROR_IF_EXC(env); + _watch.stop(); + _java_scan_watcher += _watch.elapsed_time(); + LOG(INFO) << "mmc " Review Comment: Should not be a INFO log ########## be/src/vec/exec/jni_connector.cpp: ########## @@ -70,10 +70,15 @@ namespace doris::vectorized { Status JniConnector::open(RuntimeState* state, RuntimeProfile* profile) { _state = state; _profile = profile; - ADD_TIMER(_profile, _connector_name.c_str()); - _open_scanner_time = ADD_CHILD_TIMER(_profile, "OpenScannerTime", _connector_name.c_str()); - _java_scan_time = ADD_CHILD_TIMER(_profile, "JavaScanTime", _connector_name.c_str()); - _fill_block_time = ADD_CHILD_TIMER(_profile, "FillBlockTime", _connector_name.c_str()); + ADD_TIMER_WITH_LEVEL(_profile, _connector_name.c_str(), 1); Review Comment: do not change counter level -- 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