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

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new f292135be49 branch-4.0: [enhancement](filecache) add wait time for 
other downloader in profile #57090 (#57120)
f292135be49 is described below

commit f292135be49db8a0f831d51f0f4c94b473b12d35
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 20 09:39:34 2025 +0800

    branch-4.0: [enhancement](filecache) add wait time for other downloader in 
profile #57090 (#57120)
    
    Cherry-picked from #57090
    
    Signed-off-by: zhengyu <[email protected]>
    Co-authored-by: zhengyu <[email protected]>
---
 be/src/io/cache/block_file_cache_profile.cpp  | 3 +++
 be/src/io/cache/block_file_cache_profile.h    | 1 +
 be/src/io/cache/cached_remote_file_reader.cpp | 2 ++
 be/src/io/cache/file_cache_common.h           | 1 +
 be/src/io/io_common.h                         | 1 +
 5 files changed, 8 insertions(+)

diff --git a/be/src/io/cache/block_file_cache_profile.cpp 
b/be/src/io/cache/block_file_cache_profile.cpp
index 81dec0a6622..fe6414b7878 100644
--- a/be/src/io/cache/block_file_cache_profile.cpp
+++ b/be/src/io/cache/block_file_cache_profile.cpp
@@ -69,6 +69,8 @@ 
FileCacheProfileReporter::FileCacheProfileReporter(RuntimeProfile* profile) {
                                                        cache_profile, 1);
     local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LocalIOUseTimer", 
cache_profile, 1);
     remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "RemoteIOUseTimer", 
cache_profile, 1);
+    remote_wait_timer =
+            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WaitOtherDownloaderTimer", 
cache_profile, 1);
     write_cache_io_timer =
             ADD_CHILD_TIMER_WITH_LEVEL(profile, "WriteCacheIOUseTimer", 
cache_profile, 1);
     bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, 
"BytesWriteIntoCache",
@@ -108,6 +110,7 @@ void FileCacheProfileReporter::update(const 
FileCacheStatistics* statistics) con
     COUNTER_UPDATE(num_remote_io_total, statistics->num_remote_io_total);
     COUNTER_UPDATE(local_io_timer, statistics->local_io_timer);
     COUNTER_UPDATE(remote_io_timer, statistics->remote_io_timer);
+    COUNTER_UPDATE(remote_wait_timer, statistics->remote_wait_timer);
     COUNTER_UPDATE(write_cache_io_timer, statistics->write_cache_io_timer);
     COUNTER_UPDATE(bytes_write_into_cache, statistics->bytes_write_into_cache);
     COUNTER_UPDATE(num_skip_cache_io_total, 
statistics->num_skip_cache_io_total);
diff --git a/be/src/io/cache/block_file_cache_profile.h 
b/be/src/io/cache/block_file_cache_profile.h
index 6ea1c04bb23..903f45a8663 100644
--- a/be/src/io/cache/block_file_cache_profile.h
+++ b/be/src/io/cache/block_file_cache_profile.h
@@ -70,6 +70,7 @@ struct FileCacheProfileReporter {
     RuntimeProfile::Counter* bytes_scanned_from_cache = nullptr;
     RuntimeProfile::Counter* bytes_scanned_from_remote = nullptr;
     RuntimeProfile::Counter* remote_io_timer = nullptr;
+    RuntimeProfile::Counter* remote_wait_timer = nullptr;
     RuntimeProfile::Counter* write_cache_io_timer = nullptr;
     RuntimeProfile::Counter* bytes_write_into_cache = nullptr;
     RuntimeProfile::Counter* num_skip_cache_io_total = nullptr;
diff --git a/be/src/io/cache/cached_remote_file_reader.cpp 
b/be/src/io/cache/cached_remote_file_reader.cpp
index 20747aa0317..d8e960d913e 100644
--- a/be/src/io/cache/cached_remote_file_reader.cpp
+++ b/be/src/io/cache/cached_remote_file_reader.cpp
@@ -336,6 +336,7 @@ Status CachedRemoteFileReader::read_at_impl(size_t offset, 
Slice result, size_t*
         TEST_SYNC_POINT_CALLBACK("CachedRemoteFileReader::max_wait_time", 
&max_wait_time);
         if (block_state != FileBlock::State::DOWNLOADED) {
             do {
+                SCOPED_RAW_TIMER(&stats.remote_wait_timer);
                 SCOPED_RAW_TIMER(&stats.remote_read_timer);
                 
TEST_SYNC_POINT_CALLBACK("CachedRemoteFileReader::DOWNLOADING");
                 block_state = block->wait();
@@ -403,6 +404,7 @@ void CachedRemoteFileReader::_update_stats(const 
ReadStatistics& read_stats,
         statis->bytes_read_from_remote += read_stats.bytes_read;
     }
     statis->remote_io_timer += read_stats.remote_read_timer;
+    statis->remote_wait_timer += read_stats.remote_wait_timer;
     statis->local_io_timer += read_stats.local_read_timer;
     statis->num_skip_cache_io_total += read_stats.skip_cache;
     statis->bytes_write_into_cache += read_stats.bytes_write_into_file_cache;
diff --git a/be/src/io/cache/file_cache_common.h 
b/be/src/io/cache/file_cache_common.h
index abbc4ff12fb..03d8e6f13cd 100644
--- a/be/src/io/cache/file_cache_common.h
+++ b/be/src/io/cache/file_cache_common.h
@@ -65,6 +65,7 @@ struct ReadStatistics {
     int64_t bytes_read = 0;
     int64_t bytes_write_into_file_cache = 0;
     int64_t remote_read_timer = 0;
+    int64_t remote_wait_timer = 0; // wait for other downloader
     int64_t local_read_timer = 0;
     int64_t local_write_timer = 0;
     int64_t read_cache_file_directly_timer = 0;
diff --git a/be/src/io/io_common.h b/be/src/io/io_common.h
index 82e9ae30eca..4ce57b4954e 100644
--- a/be/src/io/io_common.h
+++ b/be/src/io/io_common.h
@@ -49,6 +49,7 @@ struct FileCacheStatistics {
     int64_t bytes_read_from_local = 0;
     int64_t bytes_read_from_remote = 0;
     int64_t remote_io_timer = 0;
+    int64_t remote_wait_timer = 0;
     int64_t write_cache_io_timer = 0;
     int64_t bytes_write_into_cache = 0;
     int64_t num_skip_cache_io_total = 0;


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

Reply via email to