Skip to content

Commit

Permalink
raft/recovery: better metric for recovery bandwidth consumption
Browse files Browse the repository at this point in the history
Adds a new public_metric for recovery throttle that now tracks
how much bandwidth is consumed for raft recovery.

This is more useful because it helps tune raft_learner_recovery_rate.
If the entire bandwidth is in use, time to bump recovery rate.

(cherry picked from commit e996885)
  • Loading branch information
bharathv authored and vbotbuildovich committed Mar 20, 2024
1 parent 263db1f commit d4519b6
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/v/raft/coordinated_recovery_throttle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,22 @@ void coordinated_recovery_throttle::setup_metrics() {
namespace sm = ss::metrics;
_public_metrics.add_group(
prometheus_sanitize::metrics_name("raft:recovery"),
{sm::make_gauge(
"partition_movement_available_bandwidth",
[this] { return _throttler.available(); },
sm::description(
"Bandwidth available for partition movement. bytes/sec"))});
{// note: deprecate partition_movement_available_bandwidth
// in favor of partition_movement_consumed_bandwidth when
// possible.
sm::make_gauge(
"partition_movement_available_bandwidth",
[this] { return _throttler.available(); },
sm::description(
"Bandwidth available for partition movement. bytes/sec")),
sm::make_gauge(
"partition_movement_consumed_bandwidth",
[this] {
return _throttler.last_reset_capacity()
- _throttler.available();
},
sm::description(
"Bandwidth consumed for partition movement. bytes/sec"))});
}
}

Expand Down

0 comments on commit d4519b6

Please sign in to comment.