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

dataroaring 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 e4c6b9893a [improve](load) add more profiles in tablets channel 
(#21838)
e4c6b9893a is described below

commit e4c6b9893af971f22db614e5bade8b5cc05923c5
Author: Kaijie Chen <c...@apache.org>
AuthorDate: Fri Jul 21 13:59:15 2023 +0800

    [improve](load) add more profiles in tablets channel (#21838)
---
 be/src/runtime/tablets_channel.cpp | 5 +++++
 be/src/runtime/tablets_channel.h   | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/be/src/runtime/tablets_channel.cpp 
b/be/src/runtime/tablets_channel.cpp
index 545ee00e21..1b2bfe8a79 100644
--- a/be/src/runtime/tablets_channel.cpp
+++ b/be/src/runtime/tablets_channel.cpp
@@ -77,6 +77,8 @@ void TabletsChannel::_init_profile(RuntimeProfile* profile) {
 
     auto* memory_usage = _profile->create_child("PeakMemoryUsage", true, true);
     _slave_replica_timer = ADD_TIMER(_profile, "SlaveReplicaTime");
+    _add_batch_timer = ADD_TIMER(_profile, "AddBatchTime");
+    _write_block_timer = ADD_TIMER(_profile, "WriteBlockTime");
     _memory_usage_counter = memory_usage->AddHighWaterMarkCounter("Total", 
TUnit::BYTES);
     _write_memory_usage_counter = 
memory_usage->AddHighWaterMarkCounter("Write", TUnit::BYTES);
     _flush_memory_usage_counter = 
memory_usage->AddHighWaterMarkCounter("Flush", TUnit::BYTES);
@@ -371,6 +373,7 @@ std::ostream& operator<<(std::ostream& os, const 
TabletsChannelKey& key) {
 
 Status TabletsChannel::add_batch(const PTabletWriterAddBlockRequest& request,
                                  PTabletWriterAddBlockResult* response) {
+    SCOPED_TIMER(_add_batch_timer);
     int64_t cur_seq = 0;
     _add_batch_number_counter->update(1);
 
@@ -437,10 +440,12 @@ Status TabletsChannel::add_batch(const 
PTabletWriterAddBlockRequest& request,
     };
 
     if (request.is_single_tablet_block()) {
+        SCOPED_TIMER(_write_block_timer);
         RETURN_IF_ERROR(write_tablet_data(request.tablet_ids(0), 
[&](DeltaWriter* writer) {
             return writer->append(&send_data);
         }));
     } else {
+        SCOPED_TIMER(_write_block_timer);
         for (const auto& tablet_to_rowidxs_it : tablet_to_rowidxs) {
             RETURN_IF_ERROR(write_tablet_data(tablet_to_rowidxs_it.first, 
[&](DeltaWriter* writer) {
                 return writer->write(&send_data, tablet_to_rowidxs_it.second);
diff --git a/be/src/runtime/tablets_channel.h b/be/src/runtime/tablets_channel.h
index f728e8ab9b..514ec5a78f 100644
--- a/be/src/runtime/tablets_channel.h
+++ b/be/src/runtime/tablets_channel.h
@@ -200,6 +200,8 @@ private:
     RuntimeProfile::HighWaterMarkCounter* 
_max_tablet_write_memory_usage_counter = nullptr;
     RuntimeProfile::HighWaterMarkCounter* 
_max_tablet_flush_memory_usage_counter = nullptr;
     RuntimeProfile::Counter* _slave_replica_timer = nullptr;
+    RuntimeProfile::Counter* _add_batch_timer = nullptr;
+    RuntimeProfile::Counter* _write_block_timer = nullptr;
 };
 
 template <typename Request>


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

Reply via email to