Skip to content

Commit

Permalink
rocksdb add more tracing instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19-cw committed Jun 3, 2024
1 parent 61d8e82 commit d3627d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eth/storage/rocks/rocks_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::eth::storage::rocks::rocks_config::DbConfig;
/// Create or open the Database with the configs applied to all column families
///
/// The returned `Options` need to be stored to refer to the DB metrics
#[tracing::instrument(skip_all)]
pub fn create_or_open_db(path: impl AsRef<Path>, cf_configs: &HashMap<&'static str, Options>) -> anyhow::Result<(Arc<DB>, Options)> {
let path = path.as_ref();

Expand All @@ -38,7 +39,9 @@ pub fn create_or_open_db(path: impl AsRef<Path>, cf_configs: &HashMap<&'static s
Ok((Arc::new(db), db_opts))
}

#[tracing::instrument(skip_all)]
pub fn create_new_backup(db: &DB) -> anyhow::Result<()> {
tracing::info!("Creating new DB backup");
let mut backup_engine = backup_engine(db)?;
backup_engine.create_new_backup(db)?;
backup_engine.purge_old_backups(2)?;
Expand Down

0 comments on commit d3627d6

Please sign in to comment.