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

commit 9f0a5690a63aecc1a344973a0dcdb0d3e9e7ee41
Author: Mryange <59914473+mrya...@users.noreply.github.com>
AuthorDate: Fri Apr 26 01:10:07 2024 +0800

    [profile](scan) add projection time in scaner #34120
---
 be/src/vec/exec/scan/scanner_context.cpp | 7 +++++++
 be/src/vec/exec/scan/vscanner.cpp        | 1 +
 be/src/vec/exec/scan/vscanner.h          | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/be/src/vec/exec/scan/scanner_context.cpp 
b/be/src/vec/exec/scan/scanner_context.cpp
index 8d4a9b3a164..81e4dacba57 100644
--- a/be/src/vec/exec/scan/scanner_context.cpp
+++ b/be/src/vec/exec/scan/scanner_context.cpp
@@ -405,9 +405,11 @@ void ScannerContext::stop_scanners(RuntimeState* state) {
         std::stringstream scanner_statistics;
         std::stringstream scanner_rows_read;
         std::stringstream scanner_wait_worker_time;
+        std::stringstream scanner_projection;
         scanner_statistics << "[";
         scanner_rows_read << "[";
         scanner_wait_worker_time << "[";
+        scanner_projection << "[";
         // Scanners can in 3 state
         //  state 1: in scanner context, not scheduled
         //  state 2: in scanner worker pool's queue, scheduled but not running
@@ -421,6 +423,9 @@ void ScannerContext::stop_scanners(RuntimeState* state) {
             scanner_statistics << 
PrettyPrinter::print(scanner->_scanner->get_time_cost_ns(),
                                                        TUnit::TIME_NS)
                                << ", ";
+            scanner_projection << 
PrettyPrinter::print(scanner->_scanner->projection_time(),
+                                                       TUnit::TIME_NS)
+                               << ", ";
             scanner_rows_read << 
PrettyPrinter::print(scanner->_scanner->get_rows_read(),
                                                       TUnit::UNIT)
                               << ", ";
@@ -434,9 +439,11 @@ void ScannerContext::stop_scanners(RuntimeState* state) {
         scanner_statistics << "]";
         scanner_rows_read << "]";
         scanner_wait_worker_time << "]";
+        scanner_projection << "]";
         _scanner_profile->add_info_string("PerScannerRunningTime", 
scanner_statistics.str());
         _scanner_profile->add_info_string("PerScannerRowsRead", 
scanner_rows_read.str());
         _scanner_profile->add_info_string("PerScannerWaitTime", 
scanner_wait_worker_time.str());
+        _scanner_profile->add_info_string("PerScannerProjectionTime", 
scanner_projection.str());
     }
 
     _blocks_queue_added_cv.notify_one();
diff --git a/be/src/vec/exec/scan/vscanner.cpp 
b/be/src/vec/exec/scan/vscanner.cpp
index f3835e6c889..79fa4019687 100644
--- a/be/src/vec/exec/scan/vscanner.cpp
+++ b/be/src/vec/exec/scan/vscanner.cpp
@@ -187,6 +187,7 @@ Status VScanner::_filter_output_block(Block* block) {
 
 Status VScanner::_do_projections(vectorized::Block* origin_block, 
vectorized::Block* output_block) {
     SCOPED_RAW_TIMER(&_per_scanner_timer);
+    SCOPED_RAW_TIMER(&_projection_timer);
 
     const size_t rows = origin_block->rows();
     if (rows == 0) {
diff --git a/be/src/vec/exec/scan/vscanner.h b/be/src/vec/exec/scan/vscanner.h
index ba953192507..6e83c059706 100644
--- a/be/src/vec/exec/scan/vscanner.h
+++ b/be/src/vec/exec/scan/vscanner.h
@@ -109,6 +109,7 @@ public:
 
     int64_t get_time_cost_ns() const { return _per_scanner_timer; }
 
+    int64_t projection_time() const { return _projection_timer; }
     int64_t get_rows_read() const { return _num_rows_read; }
 
     bool is_init() const { return _is_init; }
@@ -237,6 +238,7 @@ protected:
 
     ScannerCounter _counter;
     int64_t _per_scanner_timer = 0;
+    int64_t _projection_timer = 0;
 
     bool _should_stop = false;
 };


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

Reply via email to