diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp index 6c183a96f6..e251b20379 100644 --- a/be/src/pipeline/pipeline_fragment_context.cpp +++ b/be/src/pipeline/pipeline_fragment_context.cpp @@ -887,6 +887,21 @@ void PipelineFragmentContext::_close_fragment_instance() { _runtime_state->runtime_profile()->total_time_counter()->update( _fragment_watcher.elapsed_time()); static_cast(send_report(true)); + if (_is_report_success) { + std::stringstream ss; + // Compute the _local_time_percent before pretty_print the runtime_profile + // Before add this operation, the print out like that: + // UNION_NODE (id=0):(Active: 56.720us, non-child: 00.00%) + // After add the operation, the print out like that: + // UNION_NODE (id=0):(Active: 56.720us, non-child: 82.53%) + // We can easily know the exec node execute time without child time consumed. + _runtime_state->runtime_profile()->compute_time_in_profile(); + _runtime_state->runtime_profile()->pretty_print(&ss); + if (_runtime_state->load_channel_profile()) { + _runtime_state->load_channel_profile()->pretty_print(&ss); + } + LOG(INFO) << ss.str(); + } // all submitted tasks done _exec_env->fragment_mgr()->remove_pipeline_context( std::dynamic_pointer_cast(shared_from_this())); diff --git a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp index 38b7b7457f..9087f94db5 100644 --- a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp +++ b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp @@ -1244,6 +1244,21 @@ void PipelineXFragmentContext::_close_fragment_instance() { Defer defer_op {[&]() { _is_fragment_instance_closed = true; }}; _runtime_profile->total_time_counter()->update(_fragment_watcher.elapsed_time()); static_cast(send_report(true)); + if (_is_report_success) { + std::stringstream ss; + // Compute the _local_time_percent before pretty_print the runtime_profile + // Before add this operation, the print out like that: + // UNION_NODE (id=0):(Active: 56.720us, non-child: 00.00%) + // After add the operation, the print out like that: + // UNION_NODE (id=0):(Active: 56.720us, non-child: 82.53%) + // We can easily know the exec node execute time without child time consumed. + _runtime_state->runtime_profile()->compute_time_in_profile(); + _runtime_state->runtime_profile()->pretty_print(&ss); + if (_runtime_state->load_channel_profile()) { + _runtime_state->load_channel_profile()->pretty_print(&ss); + } + LOG(INFO) << ss.str(); + } // all submitted tasks done _exec_env->fragment_mgr()->remove_pipeline_context( std::dynamic_pointer_cast(shared_from_this()));