Skip to content

Commit

Permalink
feat(pruner): account and storage history metrics (#4035)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Aug 2, 2023
1 parent bddb60b commit 86ccf2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/prune/src/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,23 @@ impl<DB: Database> Pruner<DB> {
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()?;
Expand Down

0 comments on commit 86ccf2f

Please sign in to comment.