From 2498add4ea903db248932986bec09c20fc8b969d Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Wed, 2 Aug 2023 16:23:01 +0100 Subject: [PATCH] feat(pruner): account and storage history metrics --- crates/prune/src/pruner.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/prune/src/pruner.rs b/crates/prune/src/pruner.rs index cc71421bf1fc..f34e800110df 100644 --- a/crates/prune/src/pruner.rs +++ b/crates/prune/src/pruner.rs @@ -121,13 +121,23 @@ impl Pruner { if let Some((to_block, prune_mode)) = self.modes.prune_target_block_account_history(tip_block_number)? { + let part_start = Instant::now(); self.prune_account_history(&provider, to_block, prune_mode)?; + self.metrics + .get_prune_part_metrics(PrunePart::AccountHistory) + .duration_seconds + .record(part_start.elapsed()) } if let Some((to_block, prune_mode)) = self.modes.prune_target_block_storage_history(tip_block_number)? { + let part_start = Instant::now(); self.prune_storage_history(&provider, to_block, prune_mode)?; + self.metrics + .get_prune_part_metrics(PrunePart::StorageHistory) + .duration_seconds + .record(part_start.elapsed()) } provider.commit()?;