This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new e6f4a96a403 branch-3.1:[enhancement](s3)Add TotalGetRequestTime
profile metric to the S3 reader. (#57519) (#57636)
e6f4a96a403 is described below
commit e6f4a96a40333c4a48c37fce3d323bca4ada9675
Author: daidai <[email protected]>
AuthorDate: Tue Nov 4 10:08:27 2025 +0800
branch-3.1:[enhancement](s3)Add TotalGetRequestTime profile metric to the
S3 reader. (#57519) (#57636)
bp #57519
---
be/src/io/fs/s3_file_reader.cpp | 12 +++++++++---
be/src/io/fs/s3_file_reader.h | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/be/src/io/fs/s3_file_reader.cpp b/be/src/io/fs/s3_file_reader.cpp
index eede868468f..1778b50af73 100644
--- a/be/src/io/fs/s3_file_reader.cpp
+++ b/be/src/io/fs/s3_file_reader.cpp
@@ -138,13 +138,16 @@ Status S3FileReader::read_at_impl(size_t offset, Slice
result, size_t* bytes_rea
.tag("key", _key);
std::this_thread::sleep_for(std::chrono::seconds(sleep_time));
});
-
+ SCOPED_RAW_TIMER(&_s3_stats.total_get_request_time_ns);
int total_sleep_time = 0;
while (retry_count <= max_retries) {
*bytes_read = 0;
s3_file_reader_read_counter << 1;
- // clang-format off
- auto resp = client->get_object( { .bucket = _bucket, .key = _key, },
+ auto resp = client->get_object(
+ {
+ .bucket = _bucket,
+ .key = _key,
+ },
to, offset, bytes_req, bytes_read);
// clang-format on
_s3_stats.total_get_request_counter++;
@@ -204,11 +207,14 @@ void S3FileReader::_collect_profile_before_close() {
_profile, "TooManyRequestSleepTime", TUnit::TIME_MS,
s3_profile_name);
RuntimeProfile::Counter* total_bytes_read =
ADD_CHILD_COUNTER(_profile, "TotalBytesRead", TUnit::BYTES,
s3_profile_name);
+ RuntimeProfile::Counter* total_get_request_time_ns =
+ ADD_CHILD_TIMER(_profile, "TotalGetRequestTime",
s3_profile_name);
COUNTER_UPDATE(total_get_request_counter,
_s3_stats.total_get_request_counter);
COUNTER_UPDATE(too_many_request_err_counter,
_s3_stats.too_many_request_err_counter);
COUNTER_UPDATE(too_many_request_sleep_time,
_s3_stats.too_many_request_sleep_time_ms);
COUNTER_UPDATE(total_bytes_read, _s3_stats.total_bytes_read);
+ COUNTER_UPDATE(total_get_request_time_ns,
_s3_stats.total_get_request_time_ns);
}
}
diff --git a/be/src/io/fs/s3_file_reader.h b/be/src/io/fs/s3_file_reader.h
index 36fe67b342c..58294ec1891 100644
--- a/be/src/io/fs/s3_file_reader.h
+++ b/be/src/io/fs/s3_file_reader.h
@@ -65,6 +65,7 @@ private:
int64_t too_many_request_err_counter = 0;
int64_t too_many_request_sleep_time_ms = 0;
int64_t total_bytes_read = 0;
+ int64_t total_get_request_time_ns = 0;
};
Path _path;
size_t _file_size;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]