diff --git a/be/src/io/cache/block_file_cache_profile.cpp b/be/src/io/cache/block_file_cache_profile.cpp index 81dec0a662256a..fe6414b78780d3 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 6ea1c04bb23406..903f45a8663f9c 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 08c5960fb036db..d0a4b065000759 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 abbc4ff12fb735..03d8e6f13cd704 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 82e9ae30ecada2..4ce57b4954ebce 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;