This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new efd9866b338 [chore](profile) add task state in profile (#42895) 
(#43013)
efd9866b338 is described below

commit efd9866b3381fbdc1a74a8dd9e4090b0aaf30aef
Author: Jerry Hu <mrh...@gmail.com>
AuthorDate: Fri Nov 1 09:51:55 2024 +0800

    [chore](profile) add task state in profile (#42895) (#43013)
    
    ## Proposed changes
    pick #42895
---
 be/src/pipeline/exec/scan_operator.cpp | 1 +
 be/src/pipeline/pipeline_task.cpp      | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/be/src/pipeline/exec/scan_operator.cpp 
b/be/src/pipeline/exec/scan_operator.cpp
index b631d127032..10c149ca4af 100644
--- a/be/src/pipeline/exec/scan_operator.cpp
+++ b/be/src/pipeline/exec/scan_operator.cpp
@@ -1309,6 +1309,7 @@ Status 
ScanOperatorX<LocalStateType>::get_block(RuntimeState* state, vectorized:
     if (*eos) {
         // reach limit, stop the scanners.
         local_state._scanner_ctx->stop_scanners(state);
+        local_state._scanner_profile->add_info_string("EOS", "True");
     }
 
     return Status::OK();
diff --git a/be/src/pipeline/pipeline_task.cpp 
b/be/src/pipeline/pipeline_task.cpp
index ce1ac137e17..13b672868b3 100644
--- a/be/src/pipeline/pipeline_task.cpp
+++ b/be/src/pipeline/pipeline_task.cpp
@@ -273,19 +273,22 @@ Status PipelineTask::execute(bool* eos) {
     }
 
     auto status = Status::OK();
-
+    _task_profile->add_info_string("TaskState", "Runnable");
     this->set_begin_execute_time();
     while (!_fragment_context->is_canceled()) {
         if (_data_state != SourceState::MORE_DATA && !source_can_read()) {
             set_state(PipelineTaskState::BLOCKED_FOR_SOURCE);
+            _task_profile->add_info_string("TaskState", "BlockedBySource");
             break;
         }
         if (!sink_can_write()) {
             set_state(PipelineTaskState::BLOCKED_FOR_SINK);
+            _task_profile->add_info_string("TaskState", "BlockedBySink");
             break;
         }
         if (time_spent > THREAD_TIME_SLICE) {
             COUNTER_UPDATE(_yield_counts, 1);
+            _task_profile->add_info_string("TaskState", "Yield");
             break;
         }
         // TODO llj: Pipeline entity should_yield
@@ -309,6 +312,7 @@ Status PipelineTask::execute(bool* eos) {
             }
             *eos = status.is<ErrorCode::END_OF_FILE>() ? true : *eos;
             if (*eos) { // just return, the scheduler will do finish work
+                _task_profile->add_info_string("TaskState", "Finished");
                 break;
             }
         }


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

Reply via email to