chore: Make block download metric include inflight block range requests (#10826)

Co-authored-by: garwah <garwah@garwah>
This commit is contained in:
garwah
2024-09-11 17:59:39 +10:00
committed by GitHub
parent 53a081c4d6
commit 643ea42acb

View File

@ -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::<usize>();
self.metrics.active_block_downloads.set(blocks as f64);
}
/// Adds a pending event to the FIFO queue.