Skip to content

Commit

Permalink
fix: add metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
keefel committed Nov 18, 2024
1 parent c64b71c commit d5620bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/engine/tree/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ pub(crate) struct PersistenceMetrics {
pub(crate) save_blocks_duration_seconds: Histogram,
/// How long it took for blocks to be pruned
pub(crate) prune_before_duration_seconds: Histogram,
/// The height of blocks was persisted
pub(crate) persistence_height: Gauge,
}
1 change: 1 addition & 0 deletions crates/engine/tree/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ where
UnifiedStorageWriter::commit(provider_rw, static_file_provider)?;
}
self.metrics.save_blocks_duration_seconds.record(start_time.elapsed());
self.metrics.persistence_height.set(last_block_hash_num.as_ref().map(|b| b.number).unwrap_or(0) as f64);
Ok(last_block_hash_num)
}

Expand Down

0 comments on commit d5620bb

Please sign in to comment.