Skip to content

Commit

Permalink
track repair handle_requests time (backport #29940) (#29965)
Browse files Browse the repository at this point in the history
track repair handle_requests time (#29940)

(cherry picked from commit 7cacbdc)

Co-authored-by: Jeff Biseda <[email protected]>
  • Loading branch information
mergify[bot] and jbiseda authored Jan 28, 2023
1 parent 27e7b52 commit ec32064
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/serve_repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ struct ServeRepairStats {
ping_cache_check_failed: usize,
pings_sent: usize,
decode_time_us: u64,
handle_requests_time_us: u64,
err_time_skew: usize,
err_malformed: usize,
err_sig_verify: usize,
Expand Down Expand Up @@ -524,7 +525,8 @@ impl ServeRepair {
decoded_reqs.truncate(MAX_REQUESTS_PER_ITERATION);
}

self.handle_packets(
let handle_requests_start = Instant::now();
self.handle_requests(
ping_cache,
recycler,
blockstore,
Expand All @@ -534,6 +536,7 @@ impl ServeRepair {
data_budget,
cluster_type,
);
stats.handle_requests_time_us += handle_requests_start.elapsed().as_micros() as u64;

Ok(())
}
Expand Down Expand Up @@ -610,6 +613,11 @@ impl ServeRepair {
),
("pings_sent", stats.pings_sent, i64),
("decode_time_us", stats.decode_time_us, i64),
(
"handle_requests_time_us",
stats.handle_requests_time_us,
i64
),
("err_time_skew", stats.err_time_skew, i64),
("err_malformed", stats.err_malformed, i64),
("err_sig_verify", stats.err_sig_verify, i64),
Expand Down Expand Up @@ -775,7 +783,7 @@ impl ServeRepair {
(check, ping_pkt)
}

fn handle_packets(
fn handle_requests(
&self,
ping_cache: &mut PingCache,
recycler: &PacketBatchRecycler,
Expand Down

0 comments on commit ec32064

Please sign in to comment.