Skip to content

Commit

Permalink
cloud_storage: Track hydrations in remote segment
Browse files Browse the repository at this point in the history
In remote segment, when we start hydration of a segment or chunk, we
increment the active hydration counter. This is decremented when the
hydration finishes (successful or failed). This also includes the time
taken to acquire client etc so the time during which a hydration is
active is slightly longer than the actual download time span.
  • Loading branch information
abhijat committed Nov 6, 2023
1 parent 76a381b commit ac0546e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/v/cloud_storage/remote_segment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ ss::future<> remote_segment::do_hydrate_segment() {
auto reservation = co_await _cache.reserve_space(
_size + storage::segment_index::estimate_size(_size), 1);

track_hydration t{_ts_probe};
auto res = co_await _api.download_segment(
_bucket,
_path,
Expand Down Expand Up @@ -951,6 +952,8 @@ ss::future<> remote_segment::hydrate_chunk(segment_chunk_range range) {
*this, std::move(range)};

auto measurement = _ts_probe.chunk_hydration_latency();
track_hydration t{_ts_probe};

auto res = co_await _api.download_segment(
_bucket, _path, std::move(consumer), rtc, std::make_pair(start, end));
if (res != download_result::success) {
Expand Down

0 comments on commit ac0546e

Please sign in to comment.