This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 431b47e4d420557c4b3ffa624ddd8107e1b2395c Author: Kaijie Chen <[email protected]> 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 21cee45097..1718abb132 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); @@ -486,6 +488,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); @@ -565,10 +568,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 4e523a1acf..601d575cdb 100644 --- a/be/src/runtime/tablets_channel.h +++ b/be/src/runtime/tablets_channel.h @@ -206,6 +206,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: [email protected] For additional commands, e-mail: [email protected]
