Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud_storage: Implement "carryover" cache trimming mechanism #18056

Merged
merged 10 commits into from
Apr 29, 2024
5 changes: 5 additions & 0 deletions src/v/cloud_storage/cache_probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ cache_probe::cache_probe() {
"Number of times we couldn't free enough space with a fast "
"trim and had to fall back to a slower exhaustive trim."))
.aggregate(aggregate_labels),
sm::make_counter(
"carryover_trims",
[this] { return _carryover_trims; },
sm::description("Number of times we invoked carryover trim."))
.aggregate(aggregate_labels),
sm::make_counter(
"failed_trims",
[this] { return _failed_trims; },
Expand Down
2 changes: 2 additions & 0 deletions src/v/cloud_storage/cache_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class cache_probe {

void fast_trim() { ++_fast_trims; }
void exhaustive_trim() { ++_exhaustive_trims; }
void carryover_trim() { ++_carryover_trims; }
void failed_trim() { ++_failed_trims; }

private:
Expand All @@ -55,6 +56,7 @@ class cache_probe {

int64_t _fast_trims{0};
int64_t _exhaustive_trims{0};
int64_t _carryover_trims{0};
int64_t _failed_trims{0};

metrics::internal_metric_groups _metrics;
Expand Down
Loading
Loading