From bbda42c233baf91ffda6ed4aa9265278226dbf1f Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 30 Jan 2024 16:30:51 +0800 Subject: [PATCH] update --- be/src/pipeline/exec/olap_scan_operator.cpp | 2 ++ be/src/pipeline/exec/olap_scan_operator.h | 1 + be/src/vec/exec/scan/new_olap_scan_node.cpp | 2 ++ be/src/vec/exec/scan/new_olap_scan_node.h | 1 + 4 files changed, 6 insertions(+) diff --git a/be/src/pipeline/exec/olap_scan_operator.cpp b/be/src/pipeline/exec/olap_scan_operator.cpp index 1c49ee227aeb3f..c055b1669ff4b9 100644 --- a/be/src/pipeline/exec/olap_scan_operator.cpp +++ b/be/src/pipeline/exec/olap_scan_operator.cpp @@ -136,6 +136,7 @@ Status OlapScanLocalState::_init_profile() { _filtered_segment_counter = ADD_COUNTER(_segment_profile, "NumSegmentFiltered", TUnit::UNIT); _total_segment_counter = ADD_COUNTER(_segment_profile, "NumSegmentTotal", TUnit::UNIT); _tablet_counter = ADD_COUNTER(_runtime_profile, "TabletNum", TUnit::UNIT); + _key_range_counter = ADD_COUNTER(_runtime_profile, "KeyRangesNum", TUnit::UNIT); _runtime_filter_info = ADD_LABEL_COUNTER_WITH_LEVEL(_runtime_profile, "RuntimeFilterInfo", 1); return Status::OK(); } @@ -323,6 +324,7 @@ Status OlapScanLocalState::_init_scanners(std::list* s auto build_new_scanner = [&](BaseTabletSPtr tablet, int64_t version, const std::vector& key_ranges) { + COUNTER_UPDATE(_key_range_counter, key_ranges.size()); auto scanner = vectorized::NewOlapScanner::create_shared( this, vectorized::NewOlapScanner::Params { state(), diff --git a/be/src/pipeline/exec/olap_scan_operator.h b/be/src/pipeline/exec/olap_scan_operator.h index ffd8fecd0750b2..233283a59aa3cd 100644 --- a/be/src/pipeline/exec/olap_scan_operator.h +++ b/be/src/pipeline/exec/olap_scan_operator.h @@ -104,6 +104,7 @@ class OlapScanLocalState final : public ScanLocalState { RuntimeProfile::Counter* _num_disks_accessed_counter = nullptr; RuntimeProfile::Counter* _tablet_counter = nullptr; + RuntimeProfile::Counter* _key_range_counter = nullptr; RuntimeProfile::Counter* _rows_pushed_cond_filtered_counter = nullptr; RuntimeProfile::Counter* _reader_init_timer = nullptr; RuntimeProfile::Counter* _scanner_init_timer = nullptr; diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp index f7fe7f813f231c..40e1796e758237 100644 --- a/be/src/vec/exec/scan/new_olap_scan_node.cpp +++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp @@ -85,6 +85,7 @@ Status NewOlapScanNode::prepare(RuntimeState* state) { // if you want to add some profile in scan node, even it have not new VScanner object // could add here, not in the _init_profile() function _tablet_counter = ADD_COUNTER(_runtime_profile, "TabletNum", TUnit::UNIT); + _key_range_counter = ADD_COUNTER(_runtime_profile, "KeyRangesNum", TUnit::UNIT); return Status::OK(); } @@ -594,6 +595,7 @@ Status NewOlapScanNode::_init_scanners(std::list* scanners) { auto build_new_scanner = [&](BaseTabletSPtr tablet, int64_t version, const std::vector& key_ranges, TabletReader::ReadSource read_source) { + COUNTER_UPDATE(_key_range_counter, key_ranges.size()); auto scanner = NewOlapScanner::create_shared(this, NewOlapScanner::Params { _state, diff --git a/be/src/vec/exec/scan/new_olap_scan_node.h b/be/src/vec/exec/scan/new_olap_scan_node.h index ca357b7eb7df1d..e1861a3b619df1 100644 --- a/be/src/vec/exec/scan/new_olap_scan_node.h +++ b/be/src/vec/exec/scan/new_olap_scan_node.h @@ -129,6 +129,7 @@ class NewOlapScanNode : public VScanNode { RuntimeProfile::Counter* _num_disks_accessed_counter = nullptr; RuntimeProfile::Counter* _tablet_counter = nullptr; + RuntimeProfile::Counter* _key_range_counter = nullptr; RuntimeProfile::Counter* _rows_pushed_cond_filtered_counter = nullptr; RuntimeProfile::Counter* _reader_init_timer = nullptr; RuntimeProfile::Counter* _scanner_init_timer = nullptr;