From 643ea42acb94a21ad2bb2ce4482b682dc516558a Mon Sep 17 00:00:00 2001 From: garwah <14845405+garwahl@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:59:39 +1000 Subject: [PATCH] chore: Make block download metric include inflight block range requests (#10826) Co-authored-by: garwah --- crates/engine/tree/src/download.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/engine/tree/src/download.rs b/crates/engine/tree/src/download.rs index ec173e227..04c94f144 100644 --- a/crates/engine/tree/src/download.rs +++ b/crates/engine/tree/src/download.rs @@ -163,8 +163,9 @@ where /// Sets the metrics for the active downloads fn update_block_download_metrics(&self) { - self.metrics.active_block_downloads.set(self.inflight_full_block_requests.len() as f64); - // TODO: full block range metrics + let blocks = self.inflight_full_block_requests.len() + + self.inflight_block_range_requests.iter().map(|r| r.count() as usize).sum::(); + self.metrics.active_block_downloads.set(blocks as f64); } /// Adds a pending event to the FIFO queue.