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

zclll pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 83482aae11c [chore](profile) add more counter in SetOperator (#59025)
83482aae11c is described below

commit 83482aae11c88807abcc18ed916e43773f2f1695
Author: Mryange <[email protected]>
AuthorDate: Wed Dec 17 15:12:23 2025 +0800

    [chore](profile) add more counter in SetOperator (#59025)
---
 be/src/pipeline/exec/set_probe_sink_operator.cpp | 8 ++++++++
 be/src/pipeline/exec/set_probe_sink_operator.h   | 2 ++
 be/src/pipeline/exec/set_sink_operator.cpp       | 7 +++++++
 be/src/pipeline/exec/set_sink_operator.h         | 2 ++
 be/src/pipeline/exec/set_source_operator.cpp     | 4 ++++
 be/src/pipeline/exec/set_source_operator.h       | 1 +
 6 files changed, 24 insertions(+)

diff --git a/be/src/pipeline/exec/set_probe_sink_operator.cpp 
b/be/src/pipeline/exec/set_probe_sink_operator.cpp
index 430fdb8e222..63136c97266 100644
--- a/be/src/pipeline/exec/set_probe_sink_operator.cpp
+++ b/be/src/pipeline/exec/set_probe_sink_operator.cpp
@@ -109,6 +109,9 @@ Status 
SetProbeSinkLocalState<is_intersect>::init(RuntimeState* state, LocalSink
 
     _probe_timer = ADD_TIMER(Base::custom_profile(), "ProbeTime");
     _extract_probe_data_timer = ADD_TIMER(Base::custom_profile(), 
"ExtractProbeDataTime");
+    _hash_table_size = ADD_COUNTER(_common_profile, "HashTableSize", 
TUnit::UNIT);
+    _valid_element_in_hash_table =
+            ADD_COUNTER(_common_profile, "ValidElementInHashTable", 
TUnit::UNIT);
     Parent& parent = _parent->cast<Parent>();
     _shared_state->probe_finished_children_dependency[parent._cur_child_id] = 
_dependency;
     _dependency->block();
@@ -190,6 +193,11 @@ void SetProbeSinkOperatorX<is_intersect>::_finalize_probe(
     } else {
         local_state._dependency->set_ready_to_read();
     }
+
+    // record hash table
+    COUNTER_SET(local_state._hash_table_size,
+                (int64_t)local_state._shared_state->get_hash_table_size());
+    COUNTER_SET(local_state._valid_element_in_hash_table, 
valid_element_in_hash_tbl);
 }
 
 template <bool is_intersect>
diff --git a/be/src/pipeline/exec/set_probe_sink_operator.h 
b/be/src/pipeline/exec/set_probe_sink_operator.h
index 5976a0b2a14..3730d46496d 100644
--- a/be/src/pipeline/exec/set_probe_sink_operator.h
+++ b/be/src/pipeline/exec/set_probe_sink_operator.h
@@ -66,6 +66,8 @@ private:
 
     RuntimeProfile::Counter* _extract_probe_data_timer = nullptr;
     RuntimeProfile::Counter* _probe_timer = nullptr;
+    RuntimeProfile::Counter* _hash_table_size = nullptr;
+    RuntimeProfile::Counter* _valid_element_in_hash_table = nullptr;
 };
 
 template <bool is_intersect>
diff --git a/be/src/pipeline/exec/set_sink_operator.cpp 
b/be/src/pipeline/exec/set_sink_operator.cpp
index 83ee8f05e52..d1580b4f3ac 100644
--- a/be/src/pipeline/exec/set_sink_operator.cpp
+++ b/be/src/pipeline/exec/set_sink_operator.cpp
@@ -95,6 +95,10 @@ Status SetSinkOperatorX<is_intersect>::sink(RuntimeState* 
state, vectorized::Blo
             uint64_t hash_table_size = 
local_state._shared_state->get_hash_table_size();
             valid_element_in_hash_tbl = is_intersect ? 0 : hash_table_size;
 
+            // record hash table
+            COUNTER_SET(local_state._hash_table_size, 
(int64_t)hash_table_size);
+            COUNTER_SET(local_state._valid_element_in_hash_table, 
valid_element_in_hash_tbl);
+
             
local_state._shared_state->probe_finished_children_dependency[_cur_child_id + 1]
                     ->set_ready();
             DCHECK_GT(_child_quantity, 1);
@@ -185,6 +189,9 @@ Status SetSinkLocalState<is_intersect>::init(RuntimeState* 
state, LocalSinkState
     SCOPED_TIMER(_init_timer);
     _merge_block_timer = ADD_TIMER(custom_profile(), "MergeBlocksTime");
     _build_timer = ADD_TIMER(custom_profile(), "BuildTime");
+    _hash_table_size = ADD_COUNTER(_common_profile, "HashTableSize", 
TUnit::UNIT);
+    _valid_element_in_hash_table =
+            ADD_COUNTER(_common_profile, "ValidElementInHashTable", 
TUnit::UNIT);
     auto& parent = _parent->cast<Parent>();
     _shared_state->probe_finished_children_dependency[parent._cur_child_id] = 
_dependency;
     DCHECK(parent._cur_child_id == 0);
diff --git a/be/src/pipeline/exec/set_sink_operator.h 
b/be/src/pipeline/exec/set_sink_operator.h
index 3a6a0060291..45934bd4675 100644
--- a/be/src/pipeline/exec/set_sink_operator.h
+++ b/be/src/pipeline/exec/set_sink_operator.h
@@ -61,6 +61,8 @@ private:
 
     RuntimeProfile::Counter* _merge_block_timer = nullptr;
     RuntimeProfile::Counter* _build_timer = nullptr;
+    RuntimeProfile::Counter* _hash_table_size = nullptr;
+    RuntimeProfile::Counter* _valid_element_in_hash_table = nullptr;
 
     std::shared_ptr<RuntimeFilterProducerHelperSet> 
_runtime_filter_producer_helper;
     std::shared_ptr<CountedFinishDependency> _finish_dependency;
diff --git a/be/src/pipeline/exec/set_source_operator.cpp 
b/be/src/pipeline/exec/set_source_operator.cpp
index 4b2538f9388..ef8d69af091 100644
--- a/be/src/pipeline/exec/set_source_operator.cpp
+++ b/be/src/pipeline/exec/set_source_operator.cpp
@@ -22,6 +22,7 @@
 
 #include "common/status.h"
 #include "pipeline/exec/operator.h"
+#include "util/runtime_profile.h"
 
 namespace doris::pipeline {
 #include "common/compile_check_begin.h"
@@ -32,6 +33,8 @@ Status SetSourceLocalState<is_intersect>::init(RuntimeState* 
state, LocalStateIn
     SCOPED_TIMER(_init_timer);
     _get_data_timer = ADD_TIMER(custom_profile(), "GetDataTime");
     _filter_timer = ADD_TIMER(custom_profile(), "FilterTime");
+    _get_data_from_hashtable_rows =
+            ADD_COUNTER(custom_profile(), "GetDataFromHashTableRows", 
TUnit::UNIT);
     _shared_state->probe_finished_children_dependency.resize(
             _parent->cast<SetSourceOperatorX<is_intersect>>()._child_quantity, 
nullptr);
     return Status::OK();
@@ -151,6 +154,7 @@ Status 
SetSourceOperatorX<is_intersect>::_get_data_in_hashtable(
 
     *eos = iter == hash_table_ctx.end;
 
+    COUNTER_UPDATE(local_state._get_data_from_hashtable_rows, 
local_state._result_indexs.size());
     local_state._add_result_columns();
 
     if (!output_block->mem_reuse()) {
diff --git a/be/src/pipeline/exec/set_source_operator.h 
b/be/src/pipeline/exec/set_source_operator.h
index a023888de58..d06987c6613 100644
--- a/be/src/pipeline/exec/set_source_operator.h
+++ b/be/src/pipeline/exec/set_source_operator.h
@@ -50,6 +50,7 @@ private:
 
     RuntimeProfile::Counter* _get_data_timer = nullptr;
     RuntimeProfile::Counter* _filter_timer = nullptr;
+    RuntimeProfile::Counter* _get_data_from_hashtable_rows = nullptr;
     vectorized::IColumn::Selector _result_indexs;
 };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to